allthingssecurity opened a new pull request, #26791: URL: https://github.com/apache/camel/pull/26791
# Description [CAMEL-24946](https://issues.apache.org/jira/browse/CAMEL-24946) `KeyValueAggregationRepository.remove(camelContext, key, exchange)` stored the value it deleted into the recovery store, not the `exchange` argument. When a group is completed by an incoming exchange, the last aggregated exchange is never added to the repository before `remove`, so the recovery copy missed it. With `completionSize(3)` and a failing downstream, the recovered body was `A+B` instead of `A+B+C`. This change: store the exchange passed to `remove` (marshalled like `JdbcAggregationRepository` does), still only when the key was actually removed. `KeyValueAggregationRepository` is new in 4.23 (CAMEL-24463), so this lands before its first release. Tests: new `AggregateKeyValueRepositoryRecoverTest`, plus a unit test in `KeyValueAggregationRepositoryTest`. Without the fix, the recovered body is `A+B`. With it, 14/14 pass. `camel-support` tests: 69, 0 failures. Follow-ups, not changed here because their tests need Infinispan or Redis: from reading the code, `InfinispanAggregationRepository.remove` and the non-optimistic branch of `RedisAggregationRepository.remove` store the removed value the same way. The exact one-line changes are in the JIRA ticket. Found with a TLA+ model of the Aggregate EIP and its recovery, then reproduced against the real classes. # 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 modules, 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. -- 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]
