I use Axon in several micro-services at my customer and got everything working as expected. Love it!
In our product microservice we receive “external” messages over AMQP. the user can alter and enrich the products in the user interface and when the user is done he/she can publish the products to the outside world. This triggers an outgoing message over AMQP so the other microservices are informed.
Now we have this (architectural) requirement that it should be possible to resend the outgoing messages on request. Not all messages, only the latest state related to a unique identifier. The format of the outgoing message should be the current format, so old messages should be transformed to the new message structure. We well have less than thousand products in the system.
So I will implement a rest endpoint from where the resending can be triggered. I’am wondering what is the best approach to accomplish the actual resending. The most valuable solutions in my opinion are:
- Just query the view model to get the latest state for each product and in a big loop send out all products over AMQP again;
- Create a tracking event processor, which has some kind of “enabled” flag which will be disabled by default. When it is enabled due to a request to the rest endpoint, the tracking token will be reset and it should receive the message from the evenstore in a reversed order and keep track of the unique id’s from the products which are send out. This way only the latests version of each product will be resend. When this tracking event process “isCaughtUp” with the events in the event store it will be disabled again.
- Somehow create dynamically instantiate a tracking event processor and trigger the processing as described in 2.
Which approach should I take, one of the above or is there a better alternative?