use of org.apache.camel.example.cafe.stuff.CafeAggregationStrategy in project camel by apache.
the class CafeRouteBuilder method createRegistry.
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = new JndiRegistry();
jndi.bind("drinkRouter", new DrinkRouter());
jndi.bind("orderSplitter", new OrderSplitter());
jndi.bind("barista", new Barista());
jndi.bind("waiter", new Waiter());
jndi.bind("aggregatorStrategy", new CafeAggregationStrategy());
return jndi;
}
use of org.apache.camel.example.cafe.stuff.CafeAggregationStrategy in project camel by apache.
the class CafeRouteBuilderTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
JndiRegistry jndi = super.createRegistry();
jndi.bind("drinkRouter", driverRouter);
jndi.bind("orderSplitter", new OrderSplitter());
jndi.bind("barista", new Barista());
jndi.bind("waiter", waiter);
jndi.bind("aggregatorStrategy", new CafeAggregationStrategy());
return jndi;
}
use of org.apache.camel.example.cafe.stuff.CafeAggregationStrategy in project camel by apache.
the class CafeRouteBuilder method configure.
//START SNIPPET: RouteConfig
public void configure() {
from("direct:cafe").split().method("orderSplitter").to("direct:drink");
from("direct:drink").recipientList().method("drinkRouter");
from("seda:coldDrinks?concurrentConsumers=2").to("bean:barista?method=prepareColdDrink").to("direct:deliveries");
from("seda:hotDrinks?concurrentConsumers=3").to("bean:barista?method=prepareHotDrink").to("direct:deliveries");
from("direct:deliveries").aggregate(new CafeAggregationStrategy()).method("waiter", "checkOrder").completionTimeout(5 * 1000L).to("bean:waiter?method=prepareDelivery").to("bean:waiter?method=deliverCafes");
}
Aggregations