Results 1 to 3 of 3

Thread: cafe sample xml splitter / aggregator

  1. #1
    Join Date
    Mar 2008
    Posts
    10

    Default cafe sample xml splitter / aggregator

    Can anyone explain to me how the splitter and aggregator tie together in the cafe xml sample application?

    I can't see any correlation strategy specified so the OrderSplitter split method must be setting the CORRELATION_ID behind the scenes somehow? How does it know to use the Order number as the CORRELATION_ID? Order is just a POJO.


  2. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    Aggregator relies on a default CorrelationStrategy and a default CompletionStrategy if you do not provide one. I'll explain how both work, and then I'll describe the role of a Splitter.

    The default CorrelationStrategy looks for the MessageHeaders.CORRELATION_ID header and uses that to keep track of group-membership for a sequence of Messsages. The default CompletionStrategy is called SequenceSizeCompletionStrategy, and it simply checks whether the number of Messages in the group has reached the value specified in the MessageHeaders.SEQUENCE_SIZE header.

    The Splitter will set the same CORRELATION_ID header value on each Message that results from the split, and it will also set values for both the SEQUENCE_NUMBER and SEQUENCE_SIZE headers (e.g. 1 of 3, 2 of 3, 3 of 3). The original, pre-split Message's ID is used as the correlation ID value by default.

    Hope that helps. Let me know if you have any other questions.

    -Mark

  3. #3
    Join Date
    Mar 2008
    Posts
    10

    Default

    Thanks for the reply Mark, it makes sense to me now.

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
  •