Package io.outbox.demo.starter
Class OrderPlacedListener
java.lang.Object
io.outbox.demo.starter.OrderPlacedListener
- All Implemented Interfaces:
EventListener
@Component
@OutboxListener(eventType="OrderPlaced",
aggregateType="Order")
public class OrderPlacedListener
extends Object
implements EventListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiononEvent(EventEnvelope event) Processes an outbox envelope and returns aDispatchResultto control post-dispatch behavior.
-
Constructor Details
-
OrderPlacedListener
public OrderPlacedListener()
-
-
Method Details
-
onEvent
Description copied from interface:EventListenerProcesses an outbox envelope and returns aDispatchResultto control post-dispatch behavior.Return
DispatchResult.done()on success,DispatchResult.retryAfter(java.time.Duration)for deferred re-delivery without counting againstmaxAttempts, orDispatchResult.dead(String)to immediately mark the event as DEAD without retry.- Specified by:
onEventin interfaceEventListener- Parameters:
event- the event envelope containing type, payload, and metadata- Returns:
- the dispatch result indicating completion, deferred retry, or immediate dead-letter;
must not be
null(a null return is treated as a programming error and triggers retry) - See Also:
-