javaapachecsvapache-camelsplitter

How to split a csv file 20 lines at a time using Splitter EIP, in apache camel?


I have a csv file having 2000 lines. I wish to split it 20 lines at a time and send each to a processor in apache camel. How do I do it using Splitter EIP ? Please help ..


Solution

  • I suggest to spend some time to research the Apache Camel documentation. For example on the Splitter EIP page its all documented how you can do this.

    See https://camel.apache.org/components/3.20.x/eips/split-eip.html#_splitting_files_by_grouping_n_lines_together at the section Splitting files by grouping N lines together