Announcement Announcement Module
No announcement yet.
append a string for every batch - how? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • append a string for every batch - how?

    Hi there !

    We need help in solving a challenge that we are facing in Spring Batch related work. A brief summary of the requirement is given below.

    The requirement is:

    We need to get a list of customer ids.
    For each customer id, {
    we fetch notification details in batches, say, 100 notifications at a time.{
    And For every batch we append a String.
    After all the notification details are read the email / fax is sent.

    - This we need to implement using Spring Batch Framework.
    - All the data are from Oracle DB.
    - We have to use 1.0.0Final Release of the Spring Batch Framework


  • #2
    When you say "batches of 100" do you mean a commit interval of 100?

    If so, you should be able to create a custom ItemWriter to store all the items it receives in a buffer (like a List). Then, in the flush() method, write all the items to the email (or whatever) and also write the string. In the clear() method, clear the buffer. Be sure to clear the buffer at the end of flush() too.

    Also, why 1.0.0? There's a 1.0.1 bug fix release at a minimum, and the 1.1.4 release is the most current.