Spring Batch Multiple Threads

后端 未结 1 1092
再見小時候
再見小時候 2021-02-11 07:31

I am writing a Spring Batch with idea of scaling it when required. My ApplicationContext looks like this

@Configuration
@EnableBatchProcessing
@EnableTransactio         


        
1条回答
  •  无人共我
    2021-02-11 07:58

    This is a big question

    1. Your best bet at getting a good answers would be to look through the Scaling and Parallel Processing chapter in the Spring Batch Documentation (Here)

    2. There might be some multi-threading samples in the spring batch examples (Here)

    3. An easy way to thread the Spring batch job is to Create A Future Processor - you put all your Processing Logic in a Future Object and you spring-processor class only adds Objects to the future. You writer class then wait on the future to finish before performing the write process. Sorry I don't have a sample to point you too for this - but if you have specific questions I can try and answer!

    0 讨论(0)
提交回复
热议问题