Announcement Announcement Module
No announcement yet.
cafe sample xml splitter / aggregator Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.



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