Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Multithreaded Resequencer with sequence key

  1. #1

    Default Multithreaded Resequencer with sequence key

    Hi,

    Please, help to implement next use case with Spring Integration:

    I need to process messages coming to channel in multiple threads but messages with same sequence key (can be calculated via XPath expression on message body) should be processed strictly sequentially.

    Are there any ways to do it with existing patterns, please, advise what classes to look for this functionality for.

    Thanks is advance.

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Have you looked at the Priority Channel? http://static.springsource.org/sprin...mplementations

  3. #3

    Thumbs up

    Thanks for quick reply Oleg.

    So if I will configure priority channel:

    Code:
    <channel id="simpleChannel">
        <priority-queue capacity="100" comparator="com.xxx.OrderProcessingComparator"/>
    </channel>
    Does it means if I configure multi-threaded consuming on this channel - messages which are equal according to OrderProcessingComparator#compare() can be processed simultaneously?

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Actually thinking about it more, priority channel is not what you need. How many different combinations of this 'sequence key' can you have? Is it totally arbitrary or is it something more controlled and in the range of let's say 5-10 different combinations?

  5. #5

    Default

    Hi Oleg,

    Thank you for supporting.

    Sequence key is just some specific value inside document body - this is some way to group documents together with the requirement that documents from 1 group should be processed 1-by-1 (order does not matter) but documents from different groups can be processed simultaneously.

    So sequence key is totally arbitrary and we don't have any specific range for this.
    Sequence key can be considered as "group id" to identify messages from same group.

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Let me sleep on it fro a few days. I need to think, but i'll definitely follow up.

  7. #7

    Lightbulb

    Thanks a lot, will be waiting for reply.

  8. #8
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    If you don't hear from me, just ping on this thread and i'll get a reminder

  9. #9

    Default

    Hi Oleg,

    Do you have an idea on how to implement the desirable?

    Thanks in advance for your help.

  10. #10

    Default

    Hi Oleg,

    If you will have an idea on this, please, reply.

    Thanks.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •