Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Spring Integration File Splitter Memory Usage

  1. Does split() operation on File object buffer and execute each line or do all lines get loaded in memory at once? This is to understand the memory usage if the file happens to contain 100,000+ lines.

  2. Is it fair for a transformer to return void? The usage is to compute a few logic from the payload & headers then add the computed value to headers. Is there a better way?

Thanks

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Yes, that was really a purpose of the FileSplitter. It’s internal logic is based on the FileIterator, which reads line by line an emits it to the splitter output channel.

No, the transformer cannot return void. That’s not its purpose. Sounds more like an enrichHeaders() is better for you. Messages are immutable and you just cannot modify the current message for possible further logic. You build a new message with new data (or header) and emit it as a reply downstream the flow.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading