简体   繁体   中英

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)

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM