Skip to content

[backport camel-4.14.x] CAMEL-23515: camel-nats - Use dedicated HeaderFilterStrategy aligned with sibling components#23255

Open
oscerd wants to merge 1 commit into
apache:camel-4.14.xfrom
oscerd:backport/23233-to-camel-4.14.x
Open

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

Conversation

@oscerd
Copy link
Copy Markdown
Contributor

@oscerd oscerd commented May 15, 2026

Backport of #23233

Cherry-pick of #23233 onto camel-4.14.x.

Original PR: #23233 - CAMEL-23515: camel-nats - Use dedicated HeaderFilterStrategy aligned with sibling components
Original author: @oscerd
Target branch: camel-4.14.x

Conflict resolution

  • NatsConfiguration.java: real merge conflict because the field ordering
    diverged on camel-4.14.x (JetStream fields sit directly after
    headerFilterStrategy). Resolved by keeping all the 4.14.x-specific
    surrounding code and only swapping new DefaultHeaderFilterStrategy() ->
    new NatsHeaderFilterStrategy() (the DefaultHeaderFilterStrategy import
    removal applied cleanly; NatsHeaderFilterStrategy is in the same package).
  • camel-4x-upgrade-guide-4_21.adoc: does not exist on camel-4.14.x
    (modify/delete). Resolved by dropping the 4.21 change and adding a new
    === camel-nats section to camel-4x-upgrade-guide-4_14.adoc on this
    branch. The matching camel-4x-upgrade-guide-4_14.adoc entry on main
    is added in a separate doc-sync PR per the backport upgrade-guide policy.

The camel-nats module builds cleanly on camel-4.14.x (validated
locally); the full reactor build hits the pre-existing core/camel-xml-io
schemagen JDK 21 environment issue that also affected #23233 and #23250.

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.14.8)

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