[backport camel-4.18.x] CAMEL-23515: camel-nats - Use dedicated HeaderFilterStrategy aligned with sibling components#23250
Open
oscerd wants to merge 1 commit into
Conversation
…with sibling components (apache#23233) Introduce NatsHeaderFilterStrategy following the KafkaHeaderFilterStrategy / MailHeaderFilterStrategy shape (lowerCase=true, filter headers starting with Camel/camel/org.apache.camel. in both directions), and switch the default in NatsConfiguration to use it. Signed-off-by: Andrea Cosentino <ancosen@gmail.com> (cherry picked from commit be8aad9)
davsclaus
approved these changes
May 15, 2026
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.
Backport of #23233
Cherry-pick of #23233 onto
camel-4.18.x.Original PR: #23233 - CAMEL-23515: camel-nats - Use dedicated HeaderFilterStrategy aligned with sibling components
Original author: @oscerd
Target branch:
camel-4.18.xConflict resolution
The original commit added the note to
camel-4x-upgrade-guide-4_21.adoc, which does not exist oncamel-4.18.x(modify/delete conflict). Resolved by dropping the 4.21 guide change and adding theequivalent note to the existing
=== camel-natssection incamel-4x-upgrade-guide-4_18.adoconthis branch. The corresponding
camel-4x-upgrade-guide-4_18.adocentry onmainis being added ina separate doc-sync PR per the project's backport upgrade-guide policy.
Original description
camel-natsdefaulted itsheaderFilterStrategyto a barenew DefaultHeaderFilterStrategy(),which passes every inbound NATS header (including
Camel*/camel*/org.apache.camel.*) ontothe Exchange. This introduces
NatsHeaderFilterStrategy(following theKafkaHeaderFilterStrategy/
MailHeaderFilterStrategyshape) and switches the default to use it, aligningcamel-natswiththe rest of the component catalog. Includes a unit test and the upgrade-guide note.
JIRA: https://issues.apache.org/jira/browse/CAMEL-23515 (fixVersions include 4.18.3)
Claude Code on behalf of Andrea Cosentino