allthingssecurity opened a new pull request, #27165: URL: https://github.com/apache/camel/pull/27165
# Description [CAMEL-25216](https://issues.apache.org/jira/browse/CAMEL-25216) Without optimistic locking and with recovery enabled (the defaults), `RedisAggregationRepository.remove` put the entry it removed from the map into the completed map. When an incoming message completes a group, the Aggregate EIP aggregates it and calls `remove` without adding the final state to the repository first, so that entry is the group before the last message. A completed exchange whose processing failed was recovered without the message that completed the group. CAMEL-24946 fixed the same defect in `KeyValueAggregationRepository` and named this branch of `RedisAggregationRepository.remove` as a follow-up. The optimistic branch of the same method already stores the given exchange. This change: `remove` puts the holder it already marshals from the given exchange into the completed map, instead of the removed entry. Tests: - New `AggregateRedisRecoverIT`: a group of three messages is completed, the step after the aggregator fails once, and the recovered exchange must hold all three messages. - New `RedisAggregationRepositoryOperationsIT.testPessimisticRemoveRecoversTheGivenExchange`: the exchange given to `remove` is the one that `recover` returns. - The module's ITs use the Redis test-infra service, and Docker was not available here. I ran copies of the new and existing ITs pointed at a local Redis 8.6 server: without the change the two new tests fail (`a+b` instead of `a+b+c`), with it all 15 pass (including `RedisAggregationRepositoryOperationsIT` and `AggregateRedisIT`). # 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
