TrackingEventProcessor Error Mode in distributed system


I've a case where there are 2 applications ("A" and "B".

"A" : has tracking event processors to handle events
"B" : has command handlers.

Event handler in "A" issues a command which is handled by "B".
Command handler in "B" can throw AxonTransient or AxonNonTransient Exceptions.
As its a distributed system, "A" receives wrapped Exception(RemoteHandlingException).

I've ErrorHander assigned to TEP in "A" which looks for specific exception instance to decide if to retry or not.

Can anyone help to clarify the best way to achieve this as in RemoteHandlingException I can't get the actual throwable and only the error description is available.


Anyone ?

Hi Roy,

you can throw a HandlerExecutionException (or one of its subclasses) on the handler side. This allows you to add a “details” object. That object is serialized and made available on the dispatching side.

You can either throw that exception directly or use a MessageHandlerInterceptor to do it in a generic way. Whichever works best for you.