user1702995
user1702995

Reputation: 21

How implement Spring Batch's reader?

I'm not good at English. Please point out if there is a strange sentence.

I have an issue. that is How implement ItemReader of two input for CSV file and Database. Spring Batch has JdbcCursorItemReader and FlatFileItemReader, but each class use one input Item only. I want implement that use both inputs by an ItemReader or an other class. Is this not should implement by Spring Batch ? if it's not good, so I think another means. that is process to second input by ItemProcessor or ItemWriter. someone please teach me.

Upvotes: 1

Views: 559

Answers (1)

Bob Rivers
Bob Rivers

Reputation: 5495

As Serkan said in his comment, in order to provide you a better answer, we need the case that you are working (what you are trying to achieve).

Anyway, in order to do what you want (read from two sources) you could do a job with three steps, the first two steps reading from one source and writing to a common intermediary queue/db (unifying the records) and the third step reading and processing the unified source, or you could try to implement CompositeItemReadListener.

Upvotes: 1

Related Questions