You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2026/09/23 12:23:00 UTC

[jira] [Commented] (CAMEL-24930) Resequence EIP docs say the last of duplicate messages is kept, but the first one is kept

    [ https://issues.apache.org/jira/browse/CAMEL-24930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18118342#comment-18118342 ] 

Claus Ibsen commented on CAMEL-24930:
-------------------------------------

Do NOT create blocker tickets!

> Resequence EIP docs say the last of duplicate messages is kept, but the first one is kept
> -----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-24930
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24930
>             Project: Camel
>          Issue Type: Task
>          Components: camel-core
>            Reporter: shashank
>            Priority: Blocker
>
> {{resequence-eip.adoc}} says: "By default, the Resequencer does not support duplicate messages and will only keep the last message, in case a message arrives with the same message expression." The "Allow Duplicates" section repeats this ("instead of keeping only the last duplicated message").
> Both resequencers keep the *first* message and drop the later ones:
> * Batch: {{Resequencer.createSet}} uses a {{TreeSet}}, which ignores an element equal to one it already holds. {{BatchResequencerWithDuplicateTest.testBatchResequencerNoDuplicate}} sends A(1), C(2), D(2), F(4), B(1), E(3) and asserts A, C, E, F.
> * Stream: {{ResequencerEngine.insert}} calls {{sequence.add(element)}} on a {{TreeSet}} as well. Sending B(2), A1(1), A2(1) to {{resequence(header("seqno")).stream()}} delivers A1, B. A2 is dropped.
> Proposed fix: correct the two sentences in the docs (the code behaviour is covered by an existing test, so it is the docs that are wrong), and add a test for the stream mode.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)