You don´t have to unmarshal the csv. As long as your processor sets the header („numberOfFields“) correctly (eg by counting the number of “,“) you can afterwards use choice to route to the appropriate endpoints. No need to create 2 byte[]. Your processor emits everything and you filter afterwards.
Am 06.08.2014 um 14:28 schrieb dermoritz <tantea...@hotmail.com>: > Thanks, > > in my case i don't want to use unmarchal().csv() because i don't need the > lines to be split (complet csv lines will be sent to "to"). > So my route i something like this: > > from("file:src/test/resources/?fileName=foo.csv&noop=true"). > unmarshal().gz(). > // body is byte[] > at the moment my processor takes the byte array and creates a new one (only > containing the relevant lines). > My processor must emit 2 byte[] (or one per filter set). So i have to create > 1 exchange per filter (at the moment 2) and set the header - the choice part > would be as you suggested. > > But how to create new exchanges in processor? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/How-to-relay-different-parts-of-message-to-different-endpoints-tp5754836p5754849.html > Sent from the Camel - Users mailing list archive at Nabble.com.