CAMEL-23414: Allow customization of SerializationConfig on managed Hazelcast instances#22943
Merged
CAMEL-23414: Allow customization of SerializationConfig on managed Hazelcast instances#22943
Conversation
…zelcast instances Apply a default JavaSerializationFilterConfig on the SerializationConfig of the Config built by Camel when no user-supplied Config or HazelcastInstance is provided. The default whitelists class name prefixes java., javax., org.apache.camel. and blacklists java.net. Affects: - HazelcastDefaultComponent#getOrCreateHzInstance (only when neither hazelcastInstance, hazelcastConfigUri, nor a referenced Config is supplied) - HazelcastUtil#newInstance() (no-arg) - HazelcastAggregationRepository#doStart (when no hazelcastInstance is supplied) - HazelcastIdempotentRepository#doStart (when no hazelcastInstance is supplied) A user-supplied JavaSerializationFilterConfig is respected and is not overwritten. Adds a HazelcastSerializationFilterHelper utility, a unit test, and an upgrade guide note for 4.21. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Contributor
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
Contributor
|
🧪 CI tested the following changed modules:
All tested modules (8 modules)
|
Croway
approved these changes
May 5, 2026
2 tasks
oscerd
added a commit
that referenced
this pull request
May 5, 2026
…zelcast instances (4.18.x backport) Backport of #22943 onto camel-4.18.x. Apply a default JavaSerializationFilterConfig on the SerializationConfig of the Config built by Camel when no user-supplied Config or HazelcastInstance is provided. The default whitelists class name prefixes java., javax., org.apache.camel. and blacklists java.net. Affects: - HazelcastDefaultComponent#getOrCreateHzInstance (only when neither hazelcastInstance, hazelcastConfigUri, nor a referenced Config is supplied) - HazelcastUtil#newInstance() (no-arg) - HazelcastAggregationRepository#doStart (when no hazelcastInstance is supplied) - HazelcastIdempotentRepository#doStart (when no hazelcastInstance is supplied) A user-supplied JavaSerializationFilterConfig is respected and is not overwritten. Adds a HazelcastSerializationFilterHelper utility, a unit test, and an upgrade guide note for 4.18.3. Closes #22946
2 tasks
oscerd
added a commit
that referenced
this pull request
May 5, 2026
…zelcast instances (4.14.x backport) Backport of #22943 onto camel-4.14.x. Apply a default JavaSerializationFilterConfig on the SerializationConfig of the Config built by Camel when no user-supplied Config or HazelcastInstance is provided. The default whitelists class name prefixes java., javax., org.apache.camel. and blacklists java.net. Affects: - HazelcastDefaultComponent#getOrCreateHzInstance (only when neither hazelcastInstance, hazelcastConfigUri, nor a referenced Config is supplied) - HazelcastUtil#newInstance() (no-arg) - HazelcastAggregationRepository#doStart (when no hazelcastInstance is supplied) - HazelcastIdempotentRepository#doStart (when no hazelcastInstance is supplied) A user-supplied JavaSerializationFilterConfig is respected and is not overwritten. Adds a HazelcastSerializationFilterHelper utility, a unit test, and an upgrade guide note for 4.14.8. Closes #22955
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JavaSerializationFilterConfigon theSerializationConfigof theConfigbuilt by Camel when no user-suppliedConfigorHazelcastInstanceis provided.java.,javax.,org.apache.camel.and blacklistsjava.net..JavaSerializationFilterConfigis respected and is not overwritten.Affected paths
HazelcastDefaultComponent#getOrCreateHzInstance— only when neitherhazelcastInstance,hazelcastConfigUri, nor a referencedConfigis supplied.HazelcastUtil#newInstance()(no-arg).HazelcastAggregationRepository#doStart— when nohazelcastInstanceis supplied.HazelcastIdempotentRepository#doStart— when nohazelcastInstanceis supplied.Override paths
HazelcastInstance.Configvia thehazelcastConfigUriparameter or a referencedConfigbean.JavaSerializationFilterConfigon the suppliedConfig'sSerializationConfig— Camel will not overwrite it.Jira
https://issues.apache.org/jira/browse/CAMEL-23414
Test plan
HazelcastSerializationFilterHelperTest: default applied, user filter respected, null-safe.mvn -DskipITs test): 220/220 pass.catalog/camel-catalog,dsl/camel-componentdsl,dsl/camel-endpointdslsucceeds with no regen artifacts.camel-4x-upgrade-guide-4_21.adoc.