Class SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler
java.lang.Object
dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler
- All Implemented Interfaces:
SendAndDontWaitErrorHandler
- Enclosing interface:
- SendAndDontWaitErrorHandler
public static class SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler
extends Object
implements SendAndDontWaitErrorHandler
Fallback
The
SendAndDontWaitErrorHandler that error logs any issues and rethrows the exception.The
SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler is compatible with a Durable Command Bus (e.g. using DurableQueues),
as rethrowing the exceptions allows the command to be retried-
Nested Class Summary
Nested classes/interfaces inherited from interface dk.cloudcreate.essentials.reactive.command.SendAndDontWaitErrorHandler
SendAndDontWaitErrorHandler.FallbackSendAndDontWaitErrorHandler, SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(Throwable exception, Object command, CommandHandler commandHandler) Handle an exception that occurred while processing a Command sent usingCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)
-
Constructor Details
-
RethrowingSendAndDontWaitErrorHandler
public RethrowingSendAndDontWaitErrorHandler()
-
-
Method Details
-
handleError
Description copied from interface:SendAndDontWaitErrorHandlerHandle an exception that occurred while processing a Command sent usingCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)- Specified by:
handleErrorin interfaceSendAndDontWaitErrorHandler- Parameters:
exception- the exception that occurred duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)command- the command message that caused the exception (can be wrapped in an infrastructure wrapper, such as a Message/QueuedMessage, depending on which transport channel is used)commandHandler- the command handler that can handle the command
-