Search code examples
javaevent-handlingaxonsaga

Can one event be handled by 2 axon handlers


I have 2 handlers(Saga and EventHandler) for one event. Both handlers will catch and handle event? Or just first come first served?


Solution

  • You can have multiple (Saga)EventHandlers for a certain event. These event handlers are invoked by a (Tracking)Event Processor and you can have multiple event processors in your application. For instance, you can build up a projection in one event handler and use the same handler to send an email or invoke a third-party service.