i'm looking to implement a simple string split and aggregate to learn
camel pattern implementations.

i have splitting on a space working but i can't see how to easily
reassemble the bits.  is there a way to do this without implementing a
custom aggregator strategy?

here's my main:

public static void main(String[] args) throws Exception {
CamelContext context = new DefaultCamelContext();
context.addRoutes(new RouteBuilder() {
   public void configure() {
       from("direct:inbound")
       .log("got message: ${body}")
       .split(body().tokenize(" "))
       .log("split: ${body}")
       ;
   }
});
ProducerTemplate template = context.createProducerTemplate();

context.start();

for (int i = 0; i < 10; i++) {
   template.sendBody("direct:inbound", "Test Message: " + i);
}
}

Reply via email to