Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

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

$
0
0
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

Viewing all articles
Browse latest Browse all 5648

Trending Articles