Tracking EventListeren with Rabbit/AMQP

Hello,

I would like to have a projection based on events from aggregate(s) in another JVM instance, with tracking in order to be able to replay the projections.

  1. I was able to config the rabbit publisher to publish all events from the second JVM to Rabbit MQ.
  2. I was also able to read events from Rabbit MQ and forward this to my projection.

But my question, can this work as a “tracker” when the EventListerer/Projection is in another JVM.
Or is this only possible in subcribe mode?

Kind regards,
Koen

I just read in the documentation : “Note that Tracking Processors are not compatible with the SpringAMQPMessageSource”
Is there another solution to have projections in a remote JVM? Is it possible to have a distributed event bus in axon 3.x?

Hi Koen,

if you use AMQP, the message broker will take care of the delivery of messages to its subscribers. So in this case, you would use a SubscribingProcessor. SpringAMQPMessageSource is a SubscribableMessageSource, and therefore only works in combination with Subscribing Processors.

The difference between Tracking and Subscribing processors is where the ‘initiative’ of the delivery is. Tracking processors read from a passive data source. Subscribing processors are passive themselves and expect that the message source actively delivers messages (as is the case in AMQP).

Hope this helps.
Cheers,

Allard

Hi Allard,

I think I understand the difference between Tracking and Subscribing processors.
The tracking processors will read the events directly from the event store, so it’s quite easy to replay if necessary.
This is not the case with a AMQP queue.

In my project, we have a lot of separate microservices.
As my event listener needs to listen to event from different servers/JVMs, I thought using the SpringAMQPMessageSource to receive the events.

Do I understand it correctly, that it’s not possible to “replay” these event with this setup? (because you need a Tracking processor for this?)
If yes, are there any other options than AMQP to distribute events in this situation when you are daling with multiple JVMs?

Thanks,
Koen

Hi Koen,

right now, the only “flavors” available are AMQP, Event Store (persisted) and Event Bus (in-memory).

If you need to be able to replay, but also have to read from more than one source, you could implement a StreamableMessageSource that combines two other streams (for example from two event stores). Your Saga will then process events from this combined source.

Alternatively, you could redeliver past events to the AMQP Queue, for the component to process. If you do that, just make sure you don’t redeliver to all queues, as you might trigger unwanted side-effects.

Cheers,

Allard

PS. I will give a talk about messaging patterns in Microservice based architectures next month (https://www.meetup.com/microservices-amsterdam/). Exactly this is the main topic of the presentation. I assume it will be recorded. Otherwise, I am sure we will be organizing a webinar about it.