0

I m using a Camel Multicast EIP and I have my aggregation strategy specified as below -

<multicast strategyRef="myAggregationStrategy" parallelProcessing="true">
     <to uri="direct1"/>
     <to uri="direct2"/>
</multicast>

How do I specify correlationExpression, completionTimeout for my aggregation strategy in XML DSL?

Rishi
  • 5,869
  • 7
  • 34
  • 45

2 Answers2

0

The multicast is not the aggregate EIP pattern. The aggregation strategy on the multicast is for aggregating the responses from the multicasted destinations, so here you have 2 destinations, and therefore there is 2 expected messages to be aggregated.

There is though a timeout option you can specify, in case one of the multicasted messages takes a long time to be processed.

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
  • Thanks! So as I understand this - When aggregating the responses received in Multicast, there is no need of correlationExpression.(Very similar to Splitter aggregation strategy). I just wanted to make sure that in my [Use Case](http://stackoverflow.com/questions/10610820/apache-camel-to-aggregate-multiple-rest-service-responses) response aggregation is consistent if multiple requests at the same time. – Rishi May 25 '12 at 05:53
  • Yes its like the aggregation strategy on the splitter. – Claus Ibsen May 26 '12 at 08:01
0

You don't need correlation identifier since aggregator specified after multicast refers to the messages produced by multicast endpoints. We could say that there's implicit "multicast" correlation identifier.

Regarding the multicast timeout - multicast DSL allows you to specify for how long multicast should wait until all messages are sent to the endpoint and processed:

from("direct:start")
.multicast(new MyAggregationStrategy())
  .parallelProcessing().timeout(500).to("direct:a", "direct:b", "direct:c")
.end()
.to("mock:result");
Henryk Konsek
  • 9,016
  • 5
  • 32
  • 41