camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elvio Caruana (ecaruana)" <ecaru...@cisco.com>
Subject RE: DSL how to set aggregationStrategy on a choise() when() ?
Date Fri, 08 Aug 2014 14:31:03 GMT
Re-reading your route, I think the multicast needs to go into the choice blocks, rather than
outside the choice. But then you still have the same number of multicast routes. What are
you trying to achieve?

Elvio

-----Original Message-----
From: Elvio Caruana (ecaruana) 
Sent: 08 August 2014 15:29
To: users@camel.apache.org
Subject: RE: DSL how to set aggregationStrategy on a choise() when() ?

Try .endChoice() before the aggregation?

-----Original Message-----
From: Frankiboy [mailto:mail.to.frankj@gmail.com] 
Sent: 08 August 2014 14:14
To: users@camel.apache.org
Subject: DSL how to set aggregationStrategy on a choise() when() ?

DSL how to set aggregationStrategy on a choise() when() ?
	

    I have looked at littel on this problem, but cant figure out how to do it...
 


    This dosent work, but how ? this fails with syntax error: The method
aggregationStrategy(HubAggregationStrategy) is undefined for the type ChoiceDefinition


     from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
      .bean(AddIpBean.class) 
      .bean(SetRoutingKey.class)
      .bean(Util.class, "setMiljo")
      .multicast()
      .choice()
      .when(header(HubConstants.MILJO.getValue()).contains("U"))
      .to("direct:channel1", "direct:channel2","direct:channel3")  
      .otherwise()
       .to("direct:channel1", "direct:channel2","direct:channel3") 
       .aggregationStrategy(new HubAggregationStrategy());


      This works:

	from("cxf:bean:hubws?dataFormat=MESSAGE").streamCaching()
      .bean(AddIpBean.class) 
      .bean(SetRoutingKey.class)
      .bean(Util.class, "setMiljo")
      .multicast()
      .to("direct:channel1", "direct:channel2","direct:channel3")
      .aggregationStrategy(new HubAggregationStrategy());

Frank 



--
View this message in context: http://camel.465427.n5.nabble.com/DSL-how-to-set-aggregationStrategy-on-a-choise-when-tp5754946.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message