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.
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.