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/17 00:13:27 UTC

[PR] CAMEL-25712: camel-google-pubsub - keep pulling after a failed nack of a message at max delivery attempts [camel]

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

   # Description
   
   [CAMEL-25712](https://issues.apache.org/jira/browse/CAMEL-25712)
   
   With `synchronousPull=true`, `GooglePubsubConsumer` pulls in a loop on its own thread. Since CAMEL-23142 a message whose delivery attempt reached `maxDeliveryAttempts` (the endpoint option, or the dead-letter policy of the subscription read at start) is nacked without routing. `AcknowledgeSync.nack` wraps a failure of that `ModifyAckDeadline` call in a `RuntimeCamelException`, and the `try` of the pull loop only catches `CancellationException`, `IOException` and `ExecutionException`. So one failed nack (`UNAVAILABLE` for longer than the client retries, which by default retry `ModifyAckDeadline` only on `UNAVAILABLE` within 60 s; any other status such as `DEADLINE_EXCEEDED`, which is not retried; an expired ack id with exactly-once delivery) ended the consumer thread: `run()` logged "Failure getting messages from PubSub" and returned. The route stayed started and nothing was pulled again until a restart.
   
   Change (`GooglePubsubConsumer` only): the nack of a message at the limit is wrapped in a `try`. A failure goes to the consumer's `ExceptionHandler` (WARN by default; the route's error handler with `bridgeErrorHandler=true`) and the loop goes on with the next message. The message is delivered again when its ack deadline expires and is nacked then, so a nack that keeps failing costs one WARN per redelivery, not a loop.
   
   Tests:
   - New `GooglePubsubConsumerNackFailureTest` (Mockito `SubscriberStub`, no emulator): the first pull returns a message at the limit whose nack fails with `UnavailableException`, the second pull a normal message, which must reach `mock:result` while the route is started. Bounded wait (10 s), no sleeps.
   - Without the change it fails: `mock://result Received message count. Expected: <1> but was: <0>`, with `RuntimeCamelException: ...UnavailableException` from `AcknowledgeSync.nack` in the log.
   - With the change the camel-google-pubsub tests pass: 17 run, 0 failures, 0 errors, 10 skipped (the skipped ones need the Pub/Sub emulator).
   
   What is not changed:
   - An `ExecutionException` of the pull whose cause is not retryable still ends the loop, on purpose (`synchronousPullRetryableCodes` widens the retryable codes), like the asynchronous subscriber.
   - The asynchronous subscriber path (its nack goes through the client's `AckReplyConsumer`).
   - No option or default changes, so no upgrade guide entry.
   
   What was not run: the integration tests with the Pub/Sub emulator and a real outage.
   
   # 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-25712](https://issues.apache.org/jira/browse/CAMEL-25712).
   
   # 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 camel-google-pubsub and the modules it depends on, including the formatter and import-sort plugins, and ran the camel-google-pubsub tests. 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-25712: camel-google-pubsub - keep pulling after a failed nack of a message at max delivery attempts [camel]

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

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-google/camel-google-pubsub`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 8 of 706 tested, 27 compile-only — current: 8 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **8 affected modules** (current approach: 8).
   
   **Skip-tests mode would test 8 modules** (1 direct + 7 downstream), **skip tests for 27** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (8)</summary>
   
   - `camel-google-pubsub` ← components/camel-google/camel-google-pubsub/src/main/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumer.java, components/camel-google/camel-google-pubsub/src/test/java/org/apache/camel/component/google/pubsub/GooglePubsubConsumerNackFailureTest.java
   - `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-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-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 (27)</summary>
   
   - `apache-camel`
   - `camel-allcomponents`
   - `camel-catalog`
   - `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`
   - `docs`
   - `dummy-component`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (35 modules, 5m 28s total)</summary>
   
   **Total reactor time:** 5m 28s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 46.0s | SUCCESS |
   | Camel :: JBang :: MCP | 40.1s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 38.8s | SUCCESS |
   | Camel :: Catalog :: Camel Catalog | 22.0s | SUCCESS |
   | Camel :: Component DSL | 21.9s | SUCCESS |
   | Camel :: YAML DSL :: Validator | 19.7s | SUCCESS |
   | Camel :: YAML DSL | 18.9s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 17.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 16.4s | SUCCESS |
   | Camel :: Docs | 15.4s | SUCCESS |
   | Camel :: Kamelet Main | 13.4s | SUCCESS |
   | Camel :: YAML DSL :: Deserializers | 7.8s | SUCCESS |
   | Camel :: Catalog :: Camel Route Parser | 7.6s | SUCCESS |
   | Camel :: Catalog :: Camel Report Maven Plugin | 6.9s | SUCCESS |
   | Camel :: YAML DSL :: Validator Maven Plugin | 6.6s | SUCCESS |
   | Camel :: All Components Sync point | 5.2s | SUCCESS |
   | Camel :: YAML DSL :: Maven Plugins | 2.8s | SUCCESS |
   | Camel :: Catalog :: Maven | 2.8s | SUCCESS |
   | Camel :: Catalog :: Suggest (deprecated) | 2.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 2.3s | SUCCESS |
   | Camel :: Assembly | 1.8s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.6s | SUCCESS |
   | Camel :: Coverage | 1.5s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.4s | SUCCESS |
   | Camel :: JBang :: Main | 1.2s | SUCCESS |
   | Camel :: Catalog :: Dummy Component | 1.1s | SUCCESS |
   | Camel :: Endpoint DSL :: Support | 1.0s | SUCCESS |
   | Camel :: Catalog :: Console | 0.9s | SUCCESS |
   | Camel :: Launcher :: Container | 0.7s | SUCCESS |
   | Camel :: Endpoint DSL | n/a |  |
   | Camel :: Google :: PubSub | n/a |  |
   | Camel :: Integration Tests | n/a |  |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (46.0s)
   - `Camel :: JBang :: MCP` (40.1s)
   - `Camel :: JBang :: Plugin :: Validate` (38.8s)
   - `Camel :: Catalog :: Camel Catalog` (22.0s)
   - `Camel :: Component DSL` (21.9s)
   - `Camel :: YAML DSL :: Validator` (19.7s)
   - `Camel :: YAML DSL` (18.9s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (17.7s)
   - `Camel :: JBang :: Plugin :: Testing` (16.4s)
   - `Camel :: Docs` (15.4s)
   - `Camel :: Kamelet Main` (13.4s)
   - `Camel :: YAML DSL :: Deserializers` (7.8s)
   - `Camel :: Catalog :: Camel Route Parser` (7.6s)
   - `Camel :: Catalog :: Camel Report Maven Plugin` (6.9s)
   - `Camel :: YAML DSL :: Validator Maven Plugin` (6.6s)
   - `Camel :: All Components Sync point` (5.2s)
   - `Camel :: YAML DSL :: Maven Plugins` (2.8s)
   - `Camel :: Catalog :: Maven` (2.8s)
   - `Camel :: Catalog :: Suggest (deprecated)` (2.6s)
   - `Camel :: JBang :: Plugin :: MCP` (2.3s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/38985364458)


-- 
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-25712: camel-google-pubsub - keep pulling after a failed nack of a message at max delivery attempts [camel]

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

   :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-25712: camel-google-pubsub - keep pulling after a failed nack of a message at max delivery attempts [camel]

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


-- 
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