Croway opened a new pull request, #29351: URL: https://github.com/apache/camel/pull/29351
JIRA: [CAMEL-26647](https://issues.apache.org/jira/browse/CAMEL-26647) Backport of #29332 to `camel-4.18.x` (squashed cherry-pick of 2e494100bdb4, 8f96c54ca4d4, db5fbbc1aee2, 1e6e82321670; to be merged after #29332 is merged on `main`). If #29332 changes during review, this PR is updated the same way. With `synchronousPull=true` and `ackMode=NONE`, an ack or nack of an aggregated exchange (a `List<Exchange>` body, for example from `GroupedExchangeAggregationStrategy`) read the ack id header of the outer exchange for every grouped exchange. The request carried none of the grouped messages' ids (or the same id N+1 times), so Pub/Sub delivered the grouped messages again after their ack deadline. `AcknowledgeSync` now reads the ack id of each grouped exchange, keeps the aggregated exchange's own id, and sends each id once; the nack uses the same ids. When no ack id is found at all, it sends no request and logs a WARN that names the exchange. The "Manual Acknowledgement" section of `google-pubsub-component.adoc` documents the manual ack of an aggregated exchange. Commits: - f295cc9ce50b, the squashed cherry-pick. One conflict, resolved mechanically: this branch has no catalog copy of `google-pubsub-component.adoc` (under `catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/`), so that file is left out. Otherwise it is a straight cherry-pick: `git diff` of this commit and `git diff 7167a3dd3f05 1e6e82321670 -- components/camel-google/camel-google-pubsub` (the same 4 files) have the same `git patch-id`. They differ only in the line numbers of the two doc hunks, because other parts of the page differ on this branch. `AcknowledgeSync.java` and the two new test classes are byte-identical to 1e6e82321670. No import or base-class change was needed for `camel-test-junit5`: the new unit test uses no camel-test class, and the new IT extends this branch's `PubsubTestSupport`. No generated file changes. - 7f64e7b93ed6, a test-only change for this branch, not in #29332: `AggregatedManualAcknowledgementIT` has two tests that create the same topics and subscriptions. On this branch the emulator runs once per test class (`createService()`) and `PubsubTestSupport` creates the topics before each test, so the second test failed with `ALREADY_EXISTS: Topic already exists`. `PubsubTestSupport.createTopic` and `createSubscription` now ignore `AlreadyExistsException`, as they do on `main` since CAMEL-24387 (bb6882f9f2f0), without that change's move to one emulator per JVM. Because of the second commit, this PR as a whole is not a straight cherry-pick. Tests on this branch, `components/camel-google/camel-google-pubsub` `mvn verify` with the Pub/Sub emulator: BUILD SUCCESS, 30 unit tests and 18 emulator ITs, 0 failures, with the 6 tests of the new `GooglePubsubConsumerAggregatedAckTest` and the 2 of the new `AggregatedManualAcknowledgementIT`. With `AcknowledgeSync.java` reverted to its version on this branch, 5 of the 6 `GooglePubsubConsumerAggregatedAckTest` tests fail: `expected: <[ack-1, ack-2, ack-3]> but was: <[]>` for the ack and for the nack, `but was: <[ack-1, ack-1, ack-1, ack-1]>`, and a request without ack ids in the two tests without an ack id. Only the test of a plain exchange passes. _Claude Code on behalf of Federico Mariani_ -- 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]
