Uploaded image for project: 'Spring Batch'
  1. Spring Batch
  2. BATCH-1812

ItemWriteListener does not work as expected, not called when writer runs in "recoverer"

    Details

      Description

      Configuring a chunk with an ItemWriteListener I expect a call to the 'onWriteError' every time an exception is thrown from the writer. This does not seem to be the case when the writer runs in "recoverer". The consequence being that if logging is done in the 'onWriteError', only the error causing the chunk to fail will be logged, not any errors occurring when the writer handles items one by one.

      Our solution was to introduce a processor and an ItemProcessListener, where the call to the service is done in the processor and logging is put in 'onProcessError'.

      I would suggest to fix this, or make it clear in the javadoc for ItemWriteListener how it works regarding writer running in "recoverer".

      This issue is illustrated with unittests in the attached exampleproject.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              perottobc Per Otto Bergum Christensen
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: