UnitOfWorkListener vs. CommandHanlder callback

In the scenario where an exception or failure is thrown/occurs, there
appear to be two ways to handle this in Axon, the command handler
callback, and the unitofwork listener. Are there specific scenarios
where one is more useful than the other?

Hi Chad,

both ways are meant to be used in different scenarios. The command handler callback is used by the component sending the command to receive the result of the command processing.
The unitofwork listener is meant for infrastructure components (such as the transactional interceptor). You probably don’t need to use the UnitOfWork directly, unless you are creating this type of infrastructure components.

Does this help?

Cheers,

Allard

Ok, that was my assumption, but I wanted to make sure I wasn't missing
anything :slight_smile: