Hello Jan! It seems that if you need to release the whole sequence once it is completed, and handle different sequences at the same time, one of the obvious choices would be using Aggregate EIP <https://camel.apache.org/components/4.4.x/eips/aggregate-eip.html> and set up the following properties: - correlationExpression: It will identify which group of messages the current message belongs to. - completionPredicate or AggregationStrategy object implementing Predicate: it will identify when a batch of messages should be released. - aggregationStrategy: object that will build the resulting aggregate message by merging messages into one message in the right order or handling the case of absence of some messages from a group. - completionTimeoutExpression: it will specify your timeout, after which an incomplete batch can be sent to aggregationStrategy for handling.
While Resequence EIP can also be used for this, you will need to have some correlation and merging logic in your camel routes after resequencing to assemble messages from different sequences. So, I think in your case Aggregate EIP suits better, because the only thing Resequence EIP does is, well, changing sequence of messages, but apart from resequencing you also need correlation and merging of your messages. Best regards, Ivan Kulaga On Wed, Aug 14, 2024 at 8:37 PM Jan Bares, WOOD & Co. <jan.ba...@wood.cz.invalid> wrote: > Hi, > > The resequence feature has limited customization possibilities. We need to > resequence SWIFT messages that are published in groups, each messages > contains <number>/MORE indicating more messages and <number>/LAST as last > message in a group. The time distance between first message and last > message of the same group can be in minutes. For instance: > > 7:15:10 message 003/LAST > 7:15:15 message 001/MORE > 7:15:55 message 002/MORE > > Should be resequenced to 001/MORE, 002/MORE and 003/LAST. > > It would be nice to be able to "release" the sequence once it is completed > and use timeout only as safeguard when some message is missing. > > Unfortunately, we also need to handle different sequences at the same time > because we receive SWIFTs from different parties. We need to add something > like aggregate. > > Maybe we should drop resequence and look into aggregate with > completionPredicate and use ?? to sort the aggregate before completion? > > Kind regards, Jan > > Jan Bares > Head of Calypso development | IT Development > > Phone: +420 222 096 457 > Mobile: +420 776 333 676 > Email: jan.ba...@wood.cz > > WOOD & Company > Palladium, n?m. Republiky 1079/1a, 110 00 Prague 1, Czech Republic | > wood.cz > > > > > > ________________________________ > DISCLAIMER > WOOD & Company Financial Services, a.s. and its branches are authorized > and regulated by the CNB as Home State regulator and in Poland by the KNF, > in Slovakia by the NBS, in Italy by the CONSOB and in the UK by the FCA as > Host State regulators. For further information about WOOD & Co., its > investment services, financial instruments and associated risks, safeguard > client assets (incl. compensation schemes) and contractual relationship > please see our website at www.wood.com<http://www.wood.com/> under > section Corporate Governance. Unless otherwise stated, this transmission is > neither an offer nor the solicitation of an offer to sell or purchase any > investment. All estimates, opinions and other information contained herein > are subject to change without notice and are provided in good faith but > without legal responsibility or liability. Opinion may be personal to the > author and may not reflect the opinions of WOOD & Co. Communications from > sales persons, sales traders or traders should not be regarded as > investment research and may contain opinions or trading ideas which are > different from WOOD & Co. investment research opinions. This e-mail and any > attachments are confidential and may be privileged or otherwise protected > from disclosure. If you are not a named addressee you must not use, > disclose, distribute, copy, print or rely on this e-mail and any of its > attachments. Please notify the sender that you have received this email by > mistake by replying to the email, and then delete the email and any copies > of it. Although WOOD & Co. routinely screens e-mails for viruses, > addressees should scan this e-mail and any attachments for viruses. WOOD & > Co. makes no representation or warranty as to the absence of viruses in > this e-mail or any attachments. Please note that to ensure regulatory > compliance and for the protection of our clients and business, we may > monitor and read e-mails sent to and from our server(s). >