Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I have tried to reproduce the problem, but without success. This is what I did:</p> <p><strong>The route:</strong></p> <pre><code>public class MulticastRoute extends RouteBuilder { @Override public void configure() throws Exception { AggregationStrategy myAggregationStrategy = new MyAggregationStrategy(); List&lt;String&gt; listA = Lists.newArrayList("A"); List&lt;String&gt; listB = Lists.newArrayList("B"); from("direct:multicast").routeId("multicastRoute").multicast(myAggregationStrategy).to("direct:A", "direct:B").end(); from("direct:A").setBody(constant(listA)); from("direct:B").setBody(constant(listB)); } class MyAggregationStrategy implements AggregationStrategy { @Override public org.apache.camel.Exchange aggregate(Exchange oldExchange, Exchange newExchange) { System.out.println("Aggregate called with oldExchange = " + (oldExchange == null ? "null" : oldExchange.getIn().getBody().toString()) + ", newExchange = " + newExchange.getIn().getBody().toString()); return newExchange; } } } </code></pre> <p>Created a simple test just to run the route.</p> <p><strong>The test:</strong></p> <pre><code>public class MulticastRouteTest extends CamelTestSupport { @Test public void testMulticastRoute() throws Exception { context.addRoutes(new MulticastRoute()); template.sendBody("direct:multicast", null); } } </code></pre> <p>This prints:</p> <pre><code>Aggregate called with oldExchange = null, newExchange = [A] Aggregate called with oldExchange = [A], newExchange = [B] </code></pre> <p>This is what we would expect. Hope this will help you. I can not see any difference in the way I do things, but hopefully you will spot it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload