Replaying Old Events for a New Service

When a new service is brought online I’d like to have old events (Kafka) to be replayed in order to catch up on state or rebuild state with new business logic.
This is a concept that is advertised as a benefit of EventSourcing. What is the process (possibly code sample) for making this work with the Axon Framework (Axon 4.0)?

I wanted to bump this question up.

Is this something we need to think through and engineer on our own?

KafkaMessageSource implements StreamableMessageSource, so you should be able to replay using a TrackingEventProcessor: https://docs.axoniq.io/reference-guide/1.3-infrastructure-components/event-processing#replaying-events.

Cheers,
Faik

As you are using Kafka to distribute your messages/events you can benefit from TrackingEventPocessors and ‘rebuild’ the state, so it is supported by Axon in this case. This blog post is covering this topic with technical details: https://axoniq.io/blog-overview/tracking-event-processors. Official documentation is located here https://docs.axoniq.io/reference-guide/1.3-infrastructure-components/event-processing#replaying-events. You can find my demo application here https://github.com/idugalic/digital-restaurant/blob/master/drestaurant-apps/drestaurant-microservices/README.md. Configuring Kafka (partitions, topics, groups) is an important part as well (this is out of the scope of Axon). I hope the demo will help you…

Best,
Ivan