Interface SendAndDontWaitErrorHandler
- All Known Implementing Classes:
SendAndDontWaitErrorHandler.FallbackSendAndDontWaitErrorHandler,SendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandler
public interface SendAndDontWaitErrorHandler
Exception handler that will handle errors that occur during
CommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFallbackSendAndDontWaitErrorHandlerthat only error logs any issues.
Note: If theSendAndDontWaitErrorHandler.FallbackSendAndDontWaitErrorHandleris used with a Durable Command Bus (e.g. using DurableQueues), then any failing command will not be retried.
Instead useSendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandlerstatic classFallbackSendAndDontWaitErrorHandlerthat error logs any issues and rethrows the exception.
TheSendAndDontWaitErrorHandler.RethrowingSendAndDontWaitErrorHandleris compatible with a Durable Command Bus (e.g. using DurableQueues), as rethrowing the exceptions allows the command to be retried -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(Throwable exception, Object commandMessage, CommandHandler commandHandler) Handle an exception that occurred duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)
-
Method Details
-
handleError
Handle an exception that occurred duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)- Parameters:
exception- the exception that occurred duringCommandBus.sendAndDontWait(Object)/CommandBus.sendAndDontWait(Object, Duration)commandMessage- 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
-