Package org.springframework.cloud.task.batch.listener

# 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

- ## Field Summary

  ### Fields inherited from interface org.springframework.core.Ordered

  `HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EventEmittingSkipListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)`
  `EventEmittingSkipListener(MessagePublisher messagePublisher, TaskEventProperties properties)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getOrder()`
  `void`
  `onSkipInProcess(Object item, Throwable t)`
  `void`
  `onSkipInRead(Throwable t)`
  `void`
  `onSkipInWrite(Object item, Throwable t)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### EventEmittingSkipListener

    public EventEmittingSkipListener(MessagePublisher messagePublisher, TaskEventProperties properties)

  - ### EventEmittingSkipListener

    public EventEmittingSkipListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)

- ## 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`