Axon msg bus

In our application, we have event sourcing aggregates (we will keep them in MongoDB) and we want to publish the same event on the RabbitMQ broker.

For example, when we add a new user, API sends command, constructor command handler in aggregate handles the command and sends an event. an event sourcing handler handles the event and change state.

When should we send the event to RabbitMQ (for 3rd party apps)?
In the event handler, command handler or interceptor?

Hi Ehsan,

I’d probably make a component which listens to the event and publishes it on a RabbitMQ.
So, actually none of the options you give :wink:
It might be valuable to have a look at the ‘SpringAMQPPublisher’ in the ‘axon-amqp’ package, as that probably does something in the lines of what you need.

Hope this helps!