2 years ago

#73911

test-img

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?

  1. Create data for all business logic (all data for persistence from A to E) in ItemProcessor and only handle persistence in ItemWriter.
  2. 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

Accepted video resources