[backport camel-4.18.x] CAMEL-23630: add HeaderFilterStrategy to camel-dapr#23889
Merged
oscerd merged 1 commit intoJun 10, 2026
Merged
Conversation
Adds a DaprHeaderFilterStrategy (extending DefaultHeaderFilterStrategy) exposed via DaprComponent / DaprEndpoint as the standard headerFilterStrategy option, aligning camel-dapr with the rest of the messaging-component family (camel-iggy, camel-kafka, camel-jms). The dapr-pubsub consumer no longer copies the inbound CloudEvent's pubsubName / topic into the CamelDaprPubSubName / CamelDaprTopic headers. Those two constants are producer-direction routing headers that DaprConfigurationOptionsProxy reads back and prefers over the endpoint-configured destination, so a from(dapr-pubsub).to(dapr-pubsub) route incorrectly carried the inbound destination into the producer hop. The remaining CloudEvent metadata headers are unchanged. Documented in the 4.21 upgrade guide. (cherry picked from commit 72d13bd)
davsclaus
approved these changes
Jun 9, 2026
apupier
approved these changes
Jun 9, 2026
gnodet
approved these changes
Jun 10, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Good backport adding DaprHeaderFilterStrategy to the camel-dapr component for 4.18.x. The changes correctly:
- Add a
DaprHeaderFilterStrategyclass that filters Camel-internal headers (Camel*,camel*) in both directions, plusbreadcrumbId - Add a
headerFilterStrategyendpoint option so users can customize filtering - Apply the filter in
DaprConsumer.createExchange()when mapping Dapr metadata to Camel headers - Apply the filter in
DaprProducerwhen mapping Camel headers to Dapr metadata - Include tests validating the filtering behavior
- Update generated catalog/configurer files
This is an important security hardening — it prevents external Dapr message producers from injecting Camel-internal headers via Dapr metadata.
Fully automatic review from Claude Code
oscerd
added a commit
that referenced
this pull request
Jun 10, 2026
…de guide (#23891) The dapr-pubsub consumer header change (CAMEL-23630) was backported to camel-4.18.x (#23889) and ships in 4.18.3. Per the backport upgrade-guide policy, document it in camel-4x-upgrade-guide-4_18.adoc on main (the canonical upgrade-guide history), mirroring the existing 4_21 entry. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 #23886
Cherry-pick of #23886 (squash commit
72d13bd13fb) ontocamel-4.18.x.camel-4.18.x(4.18.3-SNAPSHOT)What this backports
Adds
DaprHeaderFilterStrategy(exposed viaDaprComponent/DaprEndpointas the standardheaderFilterStrategyoption) and stops thedapr-pubsubconsumer from copying the inbound CloudEvent'spubsubName/topicinto theCamelDaprPubSubName/CamelDaprTopicheaders. Those two constants are producer-direction routing headers thatDaprConfigurationOptionsProxyreads back and prefers over the endpoint-configured destination, so afrom(dapr-pubsub).to(dapr-pubsub)route incorrectly carried the inbound destination into the producer hop. The remaining CloudEvent metadata headers are unchanged.Backport notes
camel-4x-upgrade-guide-4_21.adoc, which does not exist oncamel-4.18.x. Per project policy, upgrade-guide entries live onmain; a matchingcamel-4x-upgrade-guide-4_18.adocentry onmainwill follow so the 4.18.x line is documented.4_21upgrade-guide hunk was dropped.mvn -pl components/camel-dapr clean installon acamel-4.18.xworktree — BUILD SUCCESS, 52 tests pass (incl.DaprPubSubConsumerTest), no regenerated-file drift.Backport prepared by Claude Code on behalf of Andrea Cosentino · 🤖 Generated with Claude Code