Skip to content

[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
apache:camel-4.18.xfrom
oscerd:backport/23233-to-camel-4.18.x
Open

[backport camel-4.18.x] CAMEL-23515: camel-nats - Use dedicated HeaderFilterStrategy aligned with sibling components#23250
oscerd wants to merge 1 commit into
apache:camel-4.18.xfrom
oscerd:backport/23233-to-camel-4.18.x

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 15, 2026

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.x

Conflict resolution

The original commit added the note to camel-4x-upgrade-guide-4_21.adoc, which does not exist on
camel-4.18.x (modify/delete conflict). Resolved by dropping the 4.21 guide change and adding the
equivalent note to the existing === camel-nats section in camel-4x-upgrade-guide-4_18.adoc on
this branch. The corresponding camel-4x-upgrade-guide-4_18.adoc entry on main is being added in
a separate doc-sync PR per the project's backport upgrade-guide policy.

Original description

camel-nats defaulted its headerFilterStrategy to a bare new DefaultHeaderFilterStrategy(),
which passes every inbound NATS header (including Camel* / camel* / org.apache.camel.*) onto
the Exchange. This introduces NatsHeaderFilterStrategy (following the KafkaHeaderFilterStrategy
/ MailHeaderFilterStrategy shape) and switches the default to use it, aligning camel-nats with
the 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

…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants