Skip to content

[backport camel-4.18.x] CAMEL-24086: camel-aws2-sqs - give each FIFO batch entry a distinct MessageDeduplicationId#24785

Merged
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:fix/CAMEL-24086-4.18.x
Jul 16, 2026
Merged

[backport camel-4.18.x] CAMEL-24086: camel-aws2-sqs - give each FIFO batch entry a distinct MessageDeduplicationId#24785
oscerd merged 1 commit into
apache:camel-4.18.xfrom
oscerd:fix/CAMEL-24086-4.18.x

Conversation

@oscerd

@oscerd oscerd commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Backport of #24728 to camel-4.18.x.

Fixes CAMEL-24086 on the 4.18.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

…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>
@oscerd oscerd added the bug Something isn't working label Jul 16, 2026
@oscerd oscerd requested review from Croway and davsclaus July 16, 2026 11:09

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
  • ✅ Includes the SqsProducerFifoBatchDeduplicationTest covering both batch paths
  • ObjectHelper.isNotEmpty() null guards align with the single-message overload
  • ✅ Content-based deduplication (null ID) 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.

@oscerd oscerd merged commit 7cde02f into apache:camel-4.18.x Jul 16, 2026
3 checks passed
@oscerd oscerd self-assigned this Jul 16, 2026
@oscerd oscerd added this to the 4.18.4 milestone Jul 16, 2026
@oscerd oscerd deleted the fix/CAMEL-24086-4.18.x branch July 16, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants