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
ConstructorsConstructorDescriptionEventEmittingSkipListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties) EventEmittingSkipListener(MessagePublisher messagePublisher, TaskEventProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonSkipInProcess(Object item, Throwable t) voidvoidonSkipInWrite(Object item, Throwable t)
-
Constructor Details
-
EventEmittingSkipListener
-
EventEmittingSkipListener
public EventEmittingSkipListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)
-
-
Method Details
-
onSkipInRead
- Specified by:
onSkipInReadin interfaceorg.springframework.batch.core.SkipListener
-
onSkipInWrite
- Specified by:
onSkipInWritein interfaceorg.springframework.batch.core.SkipListener
-
onSkipInProcess
- Specified by:
onSkipInProcessin interfaceorg.springframework.batch.core.SkipListener
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceorg.springframework.core.Ordered
-