oscerd opened a new pull request, #27379:
URL: https://github.com/apache/camel/pull/27379

   _Claude Code on behalf of oscerd_
   
   ## Backport of #27213
   
   Cherry-pick of #27213 onto `camel-4.18.x`, with the adaptations listed below.
   
   **Original PR:** #27213 - CAMEL-25227: camel-azure-eventhubs - partition 
headers and default header filter
   **Original author:** @oscerd
   **Target branch:** `camel-4.18.x`
   **Jira:** [CAMEL-25227](https://issues.apache.org/jira/browse/CAMEL-25227) 
(fix version 4.18.5)
   
   ### Adaptations for camel-4.18.x
   
   This is **not** a straight cherry-pick, so it needs a review:
   
   - **`EventHubsComponent.doInit` configures the outbound filter explicitly.** 
It calls 
`setOutFilterStartsWith(DefaultHeaderFilterStrategy.CAMEL_FILTER_STARTS_WITH)`. 
On this branch `DefaultHeaderFilterStrategy` does not filter `Camel*` by 
default (CAMEL-23543 is 4.21+), so a plain `new DefaultHeaderFilterStrategy()` 
would filter nothing. Without this line, 
`camelHeadersAreNotSentAsEventProperties` fails on this branch with `Camel 
headers sent as event properties: [CamelAzureEventHubsEnqueuedTime, 
CamelMessageTimestamp, ...]`.
   - **The test uses `org.apache.camel.test.junit5.CamelTestSupport`.** This 
module still depends on `camel-test-junit5` here.
   - **The catalog copy of the component doc is left out**, because it does not 
exist on this branch. The `camel-4x-upgrade-guide-4_23.adoc` hunk is also left 
out, because the upgrade guides live on `main`; the 4.18 guide entry will be 
updated there in a follow-up doc-sync PR.
   
   The rest of the change applied cleanly.
   
   ### Original description
   
   See #27213 for the full description. In short:
   
   - A route that consumes from one Event Hub and produces to another no longer 
fails, or ignores the producer configuration, because of the partition headers 
that the consumer sets. The producer picks the partition from a header set by 
the route, then the `partitionKey`/`partitionId` option, then the partition key 
of the received event. It never reuses the received partition id.
   - `EventHubsComponent` installs a header filter strategy when none is 
configured, so the Camel-internal headers are no longer copied onto the 
`EventData` application properties. The 4.18.4 upgrade guide already said this 
was the case.
   
   On this branch, the full reactor `mvn clean install -DskipTests -DskipITs` 
is green, and the camel-azure-eventhubs unit tests pass, including 
`EventHubsConsumerToProducerTest`.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to