1
votes

I have an application built with the framework Axon 3.

  • There are 2 instances (jvm)
  • The first one handles commands and notifies the second one with RabbitMQ to construct a read model database.
  • There is an event store for this application (MongoDB)

Now I want to build a third instance and Is that possible to replay all historic events of the first instance via RabbitMQ to construct the initial state of the third instance ? and how to configure it ?

I tried the doc Axons for an answer, it seems that I should use TrackingEventProcessor instead of the default one SubscribingEventProcessor, but it does not allow to use with SpringAMQPMessageSource (mentioned in the doc)

1

1 Answers

2
votes

Axon has two modes: Tracking and Subscribing. Depending on the source of your events, you can chose either one or sometimes both styles.

AMQP is a specification for a message broker. Once a message is delivered, it is removed from the Queue it was placed on. Therefore, conceptually, it is impossible to replay those events, since they don't exist in the broker anymore.

If replays are important, make sure you use a messaging mechanism that stores the messages. In Axon, the EventStore does exactly that. For now, Axon only has the EmbeddedEventStore, but you could have an Event Store in the receiving node point to the same database as the sending node.

At the moment, at AxonIQ, we are working on an Event Store Server, that deals with this in a cleaner way (no need to share datasources between instances).