Saga Exceptions being swallowed without any logging

33 views
Skip to first unread message

António Mota

unread,
Jul 26, 2017, 7:34:42 AM7/26/17
to Axon Framework Users
Hi all.

The docs for v2.x says

Since the processing is asynchronous, Exceptions cannot be propagated to the components publishing the Event. Exceptions raised by Sagas while handling an Event are logged and discarded. 

However in the relevant part of the code in AsyncSagaEventProcessor

try {
ensureActiveUnitOfWork();
invocationCount++;
saga.handle(entry.getPublishedEvent());
} catch (Exception e) {
RetryPolicy retryPolicy = errorHandler.onErrorInvoking(saga, entry.getPublishedEvent(),
invocationCount, e);
if (retryPolicy.requiresRollback()) {
rollbackUnitOfWork(e);
}
requiresRetry = retryPolicy.requiresRescheduleEvent();
if (requiresRetry && retryPolicy.waitTime() > 0) {
Thread.sleep(retryPolicy.waitTime());
}
}


I can't see any logging of the exceptions and looking at my logs I can't find any exception logged.


I spent quite some time trying to find what happened in my code until I found out an exception being swallowed and apparently without any logging.

Is there any other place where I should look at for that logging?

Cheers.



Allard Buijze

unread,
Jul 26, 2017, 11:25:15 AM7/26/17
to Axon Framework Users
Hi Antonio,

in this case, it's the errorHandler instance that should be logging the event. The value it returns is used by the Saga Manager to decide on retrying the event, or skipping it.
The default ErrorHandler (ProceedingErrorHandler) logs the exception on error level before returning a value indicating that the SagaManager should proceed.

Where to look for the logging depends on how you have set up your loggers. Axon uses the SLF4J api to log, but it depends on the implementation you use where these logs will go.

Cheers,

Allard


--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages