Class EventEmittingSkipListener

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

public class EventEmittingSkipListener extends Object implements org.springframework.batch.core.SkipListener, org.springframework.core.Ordered
Setups up the SkipProcessListener to emit events to the spring cloud stream output channel. This listener emits the exception's message via the BatchJobHeaders.BATCH_EXCEPTION message header for each method. For SkipListener.onSkipInProcess(Object, Throwable) and SkipListener.onSkipInWrite(Object, Throwable) the body of the message consists of the item that caused the error.
Author:
Glenn Renfro, Ali Shahbour
  • Constructor Details

  • Method Details

    • onSkipInRead

      public void onSkipInRead(Throwable t)
      Specified by:
      onSkipInRead in interface org.springframework.batch.core.SkipListener
    • onSkipInWrite

      public void onSkipInWrite(Object item, Throwable t)
      Specified by:
      onSkipInWrite in interface org.springframework.batch.core.SkipListener
    • onSkipInProcess

      public void onSkipInProcess(Object item, Throwable t)
      Specified by:
      onSkipInProcess in interface org.springframework.batch.core.SkipListener
    • getOrder

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