Skip to content
bigzidane edited this page Feb 18, 2018 · 2 revisions

This is to demo how to use Spring-Batch with

  • Partitioner
  • Reader
  • Writer
  • Processor

In this example, we will create X number of threads and then each of them go through Reader and then Processor and then Writer.

  • The Reader is simply getting a parameter from Partitioner as a number.
  • The Processor is simply converting a number from Reader to a string.
  • The Writer is simply printing out the String from Processor.

Detail:

  • Partitioner receives an initial value from Job Parameter ('initValue') as 1234. And then generate threads from 1 to 6 and create 'inputForReader' value.
  • Reader will receive 'inputForReader' and then simply pass it to Reader as number.
  • Processor will receive a number as input and then convert that number to a String and then pass that String to Writer
  • Writer simply to print it out to console as an example.
Clone this wiki locally