How about something along the lines of: from("file:src/test/resources/?fileName=foo.csv&noop=true"). unmarshal().csv(). split(body()). setHeader("numberOfFields", bean("FieldCounter")). choice(). when(header("numberOfFields").isEqualTo(34) .to("direct:a") .when(header("numberOfFields").isEqualTo(65) .to("direct:b")
? I don't know if using choice without an otherwise is legal, or if you'd have to use filter first (I'm new to Camel) On 6 August 2014 11:49, dermoritz <tantea...@hotmail.com> wrote: > Thanks for this hint but how to implement the processor that splits to 2 > types: > if i scan through the file i'll end up with 2 messages/blocks (1 for each > content type). So how to implement the splitting - create 2 exchanges (for > each content type) from on exchange (1 csv file). > > Is there a way that a processor just creates a new exchange (based on the > in-exchange) an emits it? Then i would gather the data for each type and > emit one exchange per type. > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-relay-different-parts-of-message-to-different-endpoints-tp5754836p5754846.html > Sent from the Camel - Users mailing list archive at Nabble.com. >