Andrea Cosentino created CAMEL-24420:
----------------------------------------
Summary: camel-hazelcast: Apply the default
JavaSerializationFilterConfig to the remaining Camel-built configurations
Key: CAMEL-24420
URL: https://issues.apache.org/jira/browse/CAMEL-24420
Project: Camel
Issue Type: Task
Components: camel-hazelcast
Reporter: Andrea Cosentino
Assignee: Andrea Cosentino
CAMEL-23414 added {{HazelcastSerializationFilterHelper.applyDefault(Config)}}
and applied it to the Hazelcast configurations that Camel builds itself, i.e.
when the user supplies neither a {{Config}} nor a {{HazelcastInstance}}. Two
Camel-built configuration paths were not covered and are therefore inconsistent
with the behaviour documented in the 4.21 upgrade guide.
h4. 1. ReplicatedHazelcastAggregationRepository#doStart()
The class extends {{HazelcastAggregationRepository}} but overrides
{{doStart()}} with its own copy of the bootstrap block rather than delegating
to the parent, so it did not pick up the parent's change. It builds {{new
XmlConfigBuilder().build()}} and calls {{Hazelcast.newHazelcastInstance(cfg)}}
without {{applyDefault(cfg)}}, while
{{HazelcastAggregationRepository#doStart()}} does call it.
h4. 2. HazelcastDefaultComponent#getOrCreateHzClientInstance()
With {{hazelcastMode=client}}, and when neither a referenced {{ClientConfig}}
nor {{hazelcastConfigUri}} is supplied, Camel builds {{new
XmlClientConfigBuilder().build()}} and creates the client without applying a
default filter. {{ClientConfig}} exposes the same {{SerializationConfig}}, so
the helper needs a {{ClientConfig}} overload.
h4. Proposed change
* Call {{HazelcastSerializationFilterHelper.applyDefault(cfg)}} in
{{ReplicatedHazelcastAggregationRepository#doStart()}} before
{{Hazelcast.newHazelcastInstance(cfg)}}, matching the parent class.
* Add an {{applyDefault(ClientConfig)}} overload and call it on the Camel-built
branch of {{getOrCreateHzClientInstance()}}.
* Extend {{HazelcastSerializationFilterHelperTest}} to cover both.
* Update the upgrade guide, which currently lists only the paths covered by
CAMEL-23414.
As established by CAMEL-23414, a user-supplied {{Config}}/{{ClientConfig}} or a
pre-built {{HazelcastInstance}} is left untouched.
Applies to main and the camel-4.22.x, camel-4.18.x and camel-4.14.x branches.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)