[backport camel-4.14.x] CAMEL-24086: camel-aws2-sqs - give each FIFO batch entry a distinct MessageDeduplicationId#24786
Merged
Conversation
…essageDeduplicationId (apache#24728) When sending a batch to a FIFO queue, every entry is built from the same Exchange, so configureFifoAttributes derived the MessageDeduplicationId from that one Exchange via the configured strategy. The default ExchangeIdMessageDeduplicationIdStrategy returns exchange.getExchangeId(), identical for all entries, so SQS accepted the batch but silently dropped all but the first message within the deduplication window. The batch overload now appends the entry position to the strategy-provided id, giving each message a distinct, deterministic deduplication id (so a redelivered batch still deduplicates correctly). A null id (content-based deduplication via NullMessageDeduplicationIdStrategy) is left unset, and the group-id / dedup-id strategies are now null-guarded consistently with the single-message overload. Adds SqsProducerFifoBatchDeduplicationTest asserting the batch entries receive distinct deduplication ids. The single-message send path is unchanged. Signed-off-by: Andrea Cosentino <ancosen@gmail.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
gnodet
approved these changes
Jul 16, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Clean backport — LGTM.
This is an identical cherry-pick of the CAMEL-24086 fix from main (PR #24728, reviewed and merged). The fix gives each SQS FIFO batch entry a distinct MessageDeduplicationId by appending -<index> to the strategy-derived ID — without this, SQS silently drops all but the first entry in the batch.
Verified against the original review:
- ✅ Same diff as the merged PR #24728 and the 4.18.x backport (PR #24785)
- ✅ Includes the
SqsProducerFifoBatchDeduplicationTestcovering both batch paths - ✅
ObjectHelper.isNotEmpty()null guards align with the single-message overload - ✅ Content-based deduplication (
nullID) correctly left unset - ✅ No public API changes, backward compatible
Static analysis: ast-grep — no findings on modified files.
Reviewed with Claude Code on behalf of gnodet. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #24728 to
camel-4.14.x.Fixes CAMEL-24086 on the 4.14.x line. FIFO batch entries all derived one MessageDeduplicationId from the same Exchange, so SQS dropped all but the first. Each entry now gets a distinct deterministic id (strategy id + position); strategies null-guarded; content-based dedup (null id) left unset. Adds
SqsProducerFifoBatchDeduplicationTest(adapted to junit5 on this branch). Single-message path unchanged.Claude Code on behalf of oscerd