You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "allthingssecurity (via GitHub)" <gi...@apache.org> on 2026/10/02 14:29:14 UTC

[PR] CAMEL-25272: camel-rocketmq - consume a message again when its route failed, and fail an InOut send without replyToTopic [camel]

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

   # Description
   
   [CAMEL-25272](https://issues.apache.org/jira/browse/CAMEL-25272)
   
   Two places where camel-rocketmq reports a failure as success:
   
   - **Consumer.** `RocketMQConsumer`'s listener answered `CONSUME_SUCCESS` whenever the processor returned, and `RECONSUME_LATER` only when it threw. A failing route does not throw: the error handler sets the exception on the exchange. So the message of every failed exchange was acknowledged and lost (no retry topic, no dead letter queue).
   - **Producer.** An InOut exchange (for example from an HTTP consumer) sent without `replyToTopic` has no reply manager; when the asynchronous send failed, `onException` dereferenced the `null` reply manager, the `NullPointerException` skipped `exchange.setException(e)`, and the exchange completed as if the message had been sent.
   
   This change: the listener (now a package-private method, so that it can be tested without a broker) sets a thrown exception on the exchange and answers `RECONSUME_LATER` whenever the exchange has an exception, after reporting it to the exception handler; the producer sets the exception first and cancels the message key only when there is a reply manager. The upgrade guide for 4.23 gets a note: messages of failed exchanges are now consumed again (with an increasing delay, up to the max reconsume times of the consumer group, 16 by default, then the dead letter queue).
   
   Tests:
   - `RocketMQConsumerFailureTest` (new, 3 tests): a route that throws (`RECONSUME_LATER`), a processor that throws, and a successful route (`CONSUME_SUCCESS`).
   - `RocketMQProducerSendFailureTest` (new, 2 tests): an empty body, which the RocketMQ client rejects in its asynchronous send before it contacts the name server (`MQClientException`), InOnly and InOut without `replyToTopic`.
   - Without the change 2 fail: `expected: <RECONSUME_LATER> but was: <CONSUME_SUCCESS>`, and no exception for the InOut send.
   - With the change the 5 tests pass. The other tests of the module are ITs that need Docker (not run). The module skips its tests on aarch64 (`skipTests.aarch64`, the RocketMQ container is x86 only), so I ran these with `-DskipTests.aarch64=false -DskipTests=false`; on the x86 CI they run normally.
   
   # 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).
   
   # 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 and tested the affected module, including the formatter and import-sort plugins. 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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25272: camel-rocketmq - consume a message again when its route failed, and fail an InOut send without replyToTopic [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27292:
URL: https://github.com/apache/camel/pull/27292


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25272: camel-rocketmq - consume a message again when its route failed, and fail an InOut send without replyToTopic [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27292:
URL: https://github.com/apache/camel/pull/27292#issuecomment-5966399617

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `catalog/camel-catalog`
   - `components/camel-rocketmq`
   - `docs`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 9 of 698 tested, 25 compile-only — current: 9 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **9 affected modules** (current approach: 9).
   
   **Skip-tests mode would test 9 modules** (3 direct + 8 downstream), **skip tests for 25** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (9)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-catalog
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-route-parser
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-catalog
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-yaml-dsl-validator
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   - `camel-rocketmq` ← components/camel-rocketmq/src/main/docs/rocketmq-component.adoc, components/camel-rocketmq/src/main/java/org/apache/camel/component/rocketmq/RocketMQConsumer.java, components/camel-rocketmq/src/main/java/org/apache/camel/component/rocketmq/RocketMQProducer.java, components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQConsumerFailureTest.java, components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQProducerSendFailureTest.java
   - `camel-yaml-dsl-validator` ← downstream of org.apache.camel:camel-catalog
   - `camel-yaml-dsl-validator-maven-plugin` ← downstream of org.apache.camel:camel-yaml-dsl-validator
   
   </details>
   
   <details><summary>Modules with tests skipped (25)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog-console`
   - `camel-catalog-maven`
   - `camel-catalog-suggest`
   - `camel-componentdsl`
   - `camel-endpointdsl`
   - `camel-endpointdsl-support`
   - `camel-itest`
   - `camel-jbang-core`
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-kamelet-main`
   - `camel-launcher`
   - `camel-report-maven-plugin`
   - `camel-route-parser`
   - `camel-yaml-dsl`
   - `camel-yaml-dsl-deserializers`
   - `camel-yaml-dsl-maven-plugin`
   - `coverage`
   - `dummy-component`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `components/camel-rocketmq`: 2 test(s) disabled on GitHub Actions
   
   <details><summary>All tested modules (36 modules, 5m 47s total)</summary>
   
   **Total reactor time:** 5m 47s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 47.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: TUI | 43.0s | SUCCESS |
   | Camel :: JBang :: MCP | 37.7s | SUCCESS |
   | Camel :: Component DSL | 27.7s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 22.2s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 19.3s | SUCCESS |
   | Camel :: RocketMQ | 19.1s | SUCCESS |
   | Camel :: YAML DSL | 18.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 18.1s | SUCCESS |
   | Camel :: Docs | 15.0s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 10.1s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 10.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 8.2s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 8.2s | SUCCESS |
   | Camel :: Kamelet Main | 7.7s | SUCCESS |
   | Camel :: All Components Sync point | 5.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 5.1s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 3.9s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 3.7s | SUCCESS |
   | Camel :: Catalog :: Maven | 2.1s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.1s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 1.5s | SUCCESS |
   | Camel :: Coverage | 1.4s | SUCCESS |
   | Camel :: Assembly | 1.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.4s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.4s | SUCCESS |
   | Camel :: Catalog :: Console | 1.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.1s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 0.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 0.8s | SUCCESS |
   | Camel :: JBang :: Main | 0.7s | SUCCESS |
   | Camel :: Launcher :: Container | 0.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 0.5s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (47.4s)
   - `Camel :: JBang :: Plugin :: TUI` (43.0s)
   - `Camel :: JBang :: MCP` (37.7s)
   - `Camel :: Component DSL` (27.7s)
   - `Camel :: Catalog :: Camel Catalog` (22.2s)
   - `Camel :: YAML DSL :: Validator` (19.3s)
   - `Camel :: RocketMQ` (19.1s)
   - `Camel :: YAML DSL` (18.6s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (18.1s)
   - `Camel :: Docs` (15.0s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (10.1s)
   - `Camel :: YAML DSL :: Deserializers` (10.1s)
   - `Camel :: JBang :: Plugin :: Testing` (8.2s)
   - `Camel :: Catalog :: Camel Route Parser` (8.2s)
   - `Camel :: Kamelet Main` (7.7s)
   - `Camel :: All Components Sync point` (5.1s)
   - `Camel :: JBang :: Plugin :: Validate` (5.1s)
   - `Camel :: YAML DSL :: Validator Maven Plugin` (3.9s)
   - `Camel :: YAML DSL :: Maven Plugins` (3.7s)
   - `Camel :: Catalog :: Maven` (2.1s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37073542736)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25272: camel-rocketmq - consume a message again when its route failed, and fail an InOut send without replyToTopic [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27292:
URL: https://github.com/apache/camel/pull/27292#issuecomment-5956513624

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25272: camel-rocketmq - consume a message again when its route failed, and fail an InOut send without replyToTopic [camel]

Posted by "allthingssecurity (via GitHub)" <gi...@apache.org>.
allthingssecurity commented on PR #27292:
URL: https://github.com/apache/camel/pull/27292#issuecomment-5962579450

   Thanks @davsclaus, both done in 1e49692368c6:
   
   1. An exchange marked rollback only (`markRollbackOnly()` or `markRollbackOnlyLast()`) is now consumed again too; the exception handler is only called when there is an exception. New test `testRollbackOnlyExchangeIsConsumedLater` (the 6 tests pass with `-DskipTests.aarch64=false`). The upgrade note mentions it.
   2. `rocketmq-component.adoc` has a short "Error handling" section: redelivery with an increasing delay up to the max reconsume times of the consumer group (16 by default), then the dead letter queue, and `onException(...).handled(true)` to acknowledge a failed message anyway. The catalog copy is updated as well.
   
   _Claude Code on behalf of allthingssecurity_


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org