Hi Claus,

Thank you for the quick response. 

You basically advice to use a bean  to do the enriching.

Is it not possible to use more of the build in functionality of Camel to do
the job. Inside the bean I need to write a lot of code to lookup the correct
element based on the id and add the additional fields. 

>From inside a processor I cannot start another route and use the result of
this route inside the processor. 

So somthing like: 

from("direct:five4uFiles")
   .to("log: IN ==>")
   .split(body().tokenize("\n")).streaming()
   .unmarshal().bindy(BindyType.Csv, Product.class.getPackage().getName())
   .bean(Transform.class)
   .marshal(jaxbDataFormat)
   .to("log: JAXB ==>")
   .setHeader("id", xpath("/Product/id/text()")).log("id = ${in.header.id}")
   .process(new MyProcessor))
   .to("....")
   .end()
   .to("log: END ==>")
   .to("mock:result")
   ;

class MyProcess extends Processor {

     process (Exchange exchange) {
     
      Type object1 = exchange.getIn.getBody

      Route route   = new Route("route:name?id=${object.id}");

      route.evaluate();

      Type2 object2 = route.getResult.getBody

      <<code to merge object1 and object 2)

     exchange.getIn.setBody(...new body...)

}

Basically I would like to kick off a route from inside a Processor. 

}



--
View this message in context: 
http://camel.465427.n5.nabble.com/splitter-enricher-aggregator-tp5732020p5732035.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to