2 years ago
#73911

simba
ItemProcessor/ItemWriter design when business logic is complex in spring batch
I have the business(A ~ E) logic as below.
Search target -> A -> B -> C -> D -> E
The search target will be implemented as ItemReader, Each business logic includes a corresponding persistence operation (DB write).
And all operations each operation(target) must be processed within one transaction.
In this case, how to design ItemProcessor and ItemWriter is efficient?
- Create data for all business logic (all data for persistence from A to E) in ItemProcessor and only handle persistence in ItemWriter.
- Handle business logic including persistence in ItemWriter without ItemProcessor. (Of course, I will create an object responsible for each business logic, and the ItemWriter will only call it.)
spring-batch
0 Answers
Your Answer