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
ConstructorDescriptionEventEmittingSkipListener
(MessagePublisher messagePublisher, int order, TaskEventProperties properties) EventEmittingSkipListener
(MessagePublisher messagePublisher, TaskEventProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionint
getOrder()
void
onSkipInProcess
(Object item, Throwable t) void
void
onSkipInWrite
(Object item, Throwable t)
-
Constructor Details
-
EventEmittingSkipListener
-
EventEmittingSkipListener
public EventEmittingSkipListener(MessagePublisher messagePublisher, int order, TaskEventProperties properties)
-
-
Method Details
-
onSkipInRead
- Specified by:
onSkipInRead
in interfaceorg.springframework.batch.core.SkipListener
-
onSkipInWrite
- Specified by:
onSkipInWrite
in interfaceorg.springframework.batch.core.SkipListener
-
onSkipInProcess
- Specified by:
onSkipInProcess
in interfaceorg.springframework.batch.core.SkipListener
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-