camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul McCulloch <pkmccull...@gmail.com>
Subject Re: How to relay different parts of message to different endpoints
Date Wed, 06 Aug 2014 10:02:07 GMT
Perhaps, rather than filtering, your processor could just add a header
which states the number of fields in the file. You could then use Filter &
Content Based Router to send the messages to the appropriate place?


On 6 August 2014 10:18, dermoritz <tanteanni@hotmail.com> wrote:

> I have to handle csv (gz compressed) files that contain lines with
> different
> number of fields. at the moment i am only interested in lines with 35
> fields
> (contain 34 ','). I wrote a processor that filters those lines. after the
> processor the exchange is multicasted to some endpoints.
>
> Now i also need lines with 65 fields and those lines should be multicasted
> to other endpoints. So i need a way to route all 65 field lines and all 35
> field lines to different endpoints.
>
> The easy solution would be to multicast the csv to 2 processores one for
> each filter. But then i have to scan the file once per filter (there will
> com more).
>
> But is there a solution that uses one processor (so each file has only be
> scanned once)? I read about splitter pattern and multicast onPrepare, but i
> didn't get the clue how to use it in my case.
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/How-to-relay-different-parts-of-message-to-different-endpoints-tp5754836.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message