简体   繁体   中英

Can we use single flatFileItemReader bean in multiple steps running in parallel in spring batch?

I have a single file with list of exchanges. I am doing different processing on the exchanges in different steps which runs in parallel.

Can I use same instance of flatFileItemReader or I should create separate bean for each step ?

From javadoc

A FlatFileItemReader is not thread safe because it maintains state in the form of a ResourceLineReader. Be careful to configure a FlatFileItemReader using an appropriate factory or scope so that it is not shared between threads.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM