CAMEL-23516: camel-xmpp - Use dedicated HeaderFilterStrategy aligned with sibling components#23283
Merged
Merged
Conversation
…with sibling components Introduce XmppHeaderFilterStrategy following the KafkaHeaderFilterStrategy / MailHeaderFilterStrategy shape (lowerCase=true, filter headers starting with Camel/camel/org.apache.camel. in both directions), and switch the defaults in XmppEndpoint and the XmppBinding no-arg constructor to use it. 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:
|
davsclaus
approved these changes
May 18, 2026
Contributor
|
🧪 CI tested the following changed modules:
All tested modules (8 modules)
|
oscerd
added a commit
that referenced
this pull request
May 19, 2026
…with sibling components (#23296) camel-xmpp defaulted its headerFilterStrategy to a bare DefaultHeaderFilterStrategy (XmppEndpoint and the XmppBinding no-arg constructor), passing inbound XMPP message properties — including Camel* / camel* / org.apache.camel.* — straight onto the Exchange. Introduces XmppHeaderFilterStrategy (KafkaHeaderFilterStrategy / MailHeaderFilterStrategy shape) and switches both defaults to it, aligning camel-xmpp with the rest of the component catalog. Includes a unit test and the 4.21 upgrade-guide entry. Sibling of CAMEL-23515 (camel-nats). Follow-up to evaluate centralizing this in DefaultHeaderFilterStrategy is tracked as CAMEL-23543. Closes #23283 (cherry picked from commit 4a07498)
oscerd
added a commit
that referenced
this pull request
May 19, 2026
…rFilterStrategy aligned with sibling components Backport of #23283 onto camel-4.14.x. camel-xmpp defaulted its headerFilterStrategy to a bare DefaultHeaderFilterStrategy (XmppEndpoint and the XmppBinding no-arg constructor), passing inbound XMPP message properties — including Camel* / camel* / org.apache.camel.* — onto the Exchange. Introduces XmppHeaderFilterStrategy (KafkaHeaderFilterStrategy / MailHeaderFilterStrategy shape) and switches both defaults to it. Includes a unit test and the camel-4x-upgrade-guide-4_14.adoc note. (cherry picked from commit 4a07498) JIRA: https://issues.apache.org/jira/browse/CAMEL-23516 Closes #23321
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
camel-xmppdefaulted itsheaderFilterStrategyto a barenew DefaultHeaderFilterStrategy()with no configuration — atXmppEndpoint.java:106(the production path, passed intoXmppBinding)and in the
XmppBinding()no-arg constructor. The base strategy with noinFilter/inFilterPattern/inFilterStartsWithreturnsfalseforevery header, so inbound XMPP message properties (
XmppBinding.extractHeadersFrom,applyFilterToExternalHeaders) are copied onto the CamelExchangeas-is — including
Camel*/camel*/org.apache.camel.*keys thatdrive component behaviour downstream.
This aligns
camel-xmppwith the rest of the component catalog(
camel-kafka,camel-mail,camel-coap,camel-google-pubsub,camel-jms,camel-sjms, andcamel-natsvia CAMEL-23515) which allship a dedicated
HeaderFilterStrategysubclass.Changes
XmppHeaderFilterStrategyfollowing theKafkaHeaderFilterStrategy/MailHeaderFilterStrategyshape(
setLowerCase(true), in/outsetInFilterStartsWith(CAMEL_FILTER_STARTS_WITH)).XmppEndpointand theXmppBindingno-arg constructor now default tonew XmppHeaderFilterStrategy(); the now-unusedDefaultHeaderFilterStrategyimport is removed from both(
XmppHeaderFilterStrategyis in the same package).Camel*filtering, lowercasevariants, and pass-through of non-Camel headers.
=== camel-xmpp).Test plan
mvn -pl components/camel-xmpp -DskipTests installXmppHeaderFilterStrategyTest(4 tests, green)JIRA
https://issues.apache.org/jira/browse/CAMEL-23516
Sibling of CAMEL-23515 (camel-nats, merged to main/4.18.x/4.14.x).
Backports to 4.18.x and 4.14.x planned per the
fixVersions.Claude Code on behalf of Andrea Cosentino