allthingssecurity opened a new pull request, #30570: URL: https://github.com/apache/camel/pull/30570
# Description [CAMEL-27323](https://issues.apache.org/jira/browse/CAMEL-27323) The `ignite-messaging` consumer sets the `CamelIgniteMessagingTopic` header to the topic it received a message on, and the `ignite-messaging` producer sends to the topic named in that header instead of the topic of its endpoint. So a route such as `from("ignite-messaging:orders").to("ignite-messaging:audit")` sent every message back to `orders`: the consumer of `orders` received it again, the route sent it again, and so on for ever, while `audit` never got a message. This is the class of CAMEL-25898 (#28426, camel-ibm-cos bucket header) and CAMEL-25227 (#27213, camel-azure-eventhubs partition headers). Fix: - The consumer also sets the exchange property `CamelIgniteMessagingReceivedTopic` (`IgniteConstants.IGNITE_MESSAGING_RECEIVED_TOPIC`) to the topic it received the message on. - The producer uses the `CamelIgniteMessagingTopic` header only when it differs from that property, that is when the route chose a topic; a header that still holds the received topic describes the message and the producer sends to the topic of its endpoint. This is what camel-azure-eventhubs does with `CamelAzureEventHubsReceivedPartitionId`, and it keeps the header working as documented for routes that set it (existing `IgniteMessagingTest.testProducerSendMessageTopicInHeader`, and the new control test with a consumer). - A route that wants to send a received message back to the topic it came from through the header removes the property. The component page says so, and the 4.24 upgrade guide has an entry. - The header description (and so the generated JSON and DSL) is unchanged; the property is not a header and has no `@Metadata`, like the eventhubs properties. Tests: `IgniteMessagingBridgeTest` (camel-ignite, the embedded Ignite node of camel-test-infra-ignite, unique topics per test): a route from one topic to another with one message sent to the first topic: the second topic must get it once, and the route and the first topic must see it only once; and a control where the route sets the topic header itself, which must still be used (passes on main too). Runs (offline, Ignite 2.18.0): the bridge test fails on main (nothing arrives on the second topic within 10 s, while the route keeps receiving the message) and passes with the fix; camel-ignite module tests 65 run, 0 failures, 10 skipped; the new test class 20 times in one JVM: 40 of 40. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it): [CAMEL-27323](https://issues.apache.org/jira/browse/CAMEL-27323). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (I built the core modules and camel-ignite with the formatter and import-sort plugins, and copied the component page to the catalog. No option or header metadata changed. I did not run the full root build.) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. This PR was prepared with Claude Code (Claude Opus 5.5). The commit carries a `Co-Authored-By` trailer. _Claude Code on behalf of allthingssecurity_ 🤖 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]
