Thirukumaran
Thirukumaran

Reputation: 367

Spring Batch Writer

For “READ-PROCESS-WRITE” process, it means “read” data from the resources (csv, xml or database), “process” it and “write” it to other resources (csv, xml and database). For example, a step may read data from a CSV file, process it and write it into the database

Is springBatch will support to "Write" any message to a downstream through another webservice API(not to "Write" as CSV, XML and database)

Upvotes: 0

Views: 845

Answers (1)

Philip Wrage
Philip Wrage

Reputation: 1569

The ItemWriter<T> and ItemStreamWriter<T> are simple functional interfaces. While the Spring Batch team have already implemented many specific ItemWriter classes, you are free to implement your own given whatever business needs you have.

Basically, the ItemWriter<T> takes in a List<T> and writes out those items of type T as you choose to implement in the write method.

void write(java.util.List<? extends T> items)
    throws java.lang.Exception

If you already have code written that performs the write operations you wish to perform with your ItemWriter<T>, then you may also be able to use the ItemWriterAdapter to create an ItemWriter that delegates to your existing code.

Upvotes: 1

Related Questions