Class EventEmittingItemWriteListener

java.lang.Object
org.springframework.cloud.task.batch.listener.EventEmittingItemWriteListener
All Implemented Interfaces:
org.springframework.batch.core.ItemWriteListener, org.springframework.batch.core.StepListener, org.springframework.core.Ordered

public class EventEmittingItemWriteListener extends Object implements org.springframework.batch.core.ItemWriteListener, org.springframework.core.Ordered
Setups up the ItemWriteEventsListener to emit events to the spring cloud stream output channel. Each method provides an informational message. ItemWriteListener.onWriteError(Exception, List) provides a message as well as the exception's message via the BatchJobHeaders.BATCH_EXCEPTION message header.
Author:
Glenn Renfro, Ali Shahbour
  • Constructor Details

  • Method Details

    • beforeWrite

      public void beforeWrite(List items)
      Specified by:
      beforeWrite in interface org.springframework.batch.core.ItemWriteListener
    • afterWrite

      public void afterWrite(List items)
      Specified by:
      afterWrite in interface org.springframework.batch.core.ItemWriteListener
    • onWriteError

      public void onWriteError(Exception exception, List items)
      Specified by:
      onWriteError in interface org.springframework.batch.core.ItemWriteListener
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered