oscerd opened a new pull request, #24728:
URL: https://github.com/apache/camel/pull/24728

   ## Description
   
   Fixes [CAMEL-24086](https://issues.apache.org/jira/browse/CAMEL-24086).
   
   When sending a batch (a `List` body, or a `String` split by 
`batchSeparator`) to a **FIFO** SQS queue, every entry is built from the same 
`Exchange`, so `configureFifoAttributes(SendMessageBatchRequestEntry.Builder, 
Exchange)` derived the `MessageDeduplicationId` from that one `Exchange`. 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 5-minute 
deduplication window.
   
   ## Fix
   
   - The batch overload now appends the entry position to the strategy-provided 
id (`<id>-<index>`), giving each message a **distinct, deterministic** 
deduplication id — a redelivered batch still deduplicates correctly.
   - A `null` id (content-based deduplication via 
`NullMessageDeduplicationIdStrategy`) is left unset.
   - The group-id / dedup-id strategies are now **null-guarded** consistently 
with the single-message overload (the batch overload previously could NPE on a 
null strategy).
   - The single-message send path is unchanged.
   
   ## Tests
   
   Adds `SqsProducerFifoBatchDeduplicationTest` — sends a 4-element batch to a 
`.fifo` queue and asserts the four entries receive four **distinct** 
deduplication ids (and each sets a group id). Against the old code all four 
shared one id, so the test fails without the fix. The existing 
`SqsProducerBatchTest` still passes.
   
   ## Scope note
   
   This PR addresses only the FIFO deduplication-id collision. The separate 
"batch not chunked to the 10-entry API limit" observation is not included here.
   
   ## Backport
   
   Same code on `camel-4.18.x` and `camel-4.14.x`; will be backported after 
merge (fixVersions 4.22.0 / 4.18.4 / 4.14.9).
   
   ---
   _Claude Code on behalf of oscerd_


-- 
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]

Reply via email to