RabbitMQ events replay management


suppose we have an event in a context that needs to be denormalized and sent over a RabbitMQ queue where another context is listening.

When the queue message is received from the other context, it applies a new command/event chain and everything goes fine.

After a while, another different context from the two above needs to receive the same event. Nothing simpler, i will add another eventhandler that writes the event on the queue listened by the new context.

At this point, I replay all the events in event store. Due to rabbitmq eventhandlers is excluded from the ones managed by the replay cluster, the command/event chain on the other context never happens to start.

I do not think that upcasters are useful in this case because they act as a “decorator” over an existing event.
The most obvious solutions seems to include the rabbitmq eventhandlers in the replay cluster, but this will double the events when I replay the event stream.

Another solution is to write a batch that sends the “missing” commands but i hope this is not the final answer because it sucks.

Any idea? Hope someone helps. :slight_smile:


if I understand correctly, you implemented a new part of your system as a separate context and now you need to initialize it with past events because it can be put online. If this is the scenario, I don’t see the need to build a particularly clean and ‘standard’ solution: it’s a one time operation, just be sure to protect the existing contexts from the event replay and you’re fine. If your new context has visibility of the event store database you might skip RabbitMQ and replay events directly from database to event bus.

Did I get the problem correctly?