Replaying events with Kafka as the message bus

Hi,

I’ve set up Kafka as the message bus and I’m writing events to an Postgres DB. When I do not use Kafka and let the SimpleEventBus handle event routing I’m able to trigger replay by deleting the tracking token from the token store.
The same does not happen when I use Kafka as the message bus. I’ve got the KafkaMessageSource property set up in my spring profile and I also have a consumer group and group-id, all the properties that the documentation asks to have.

https://docs.axoniq.io/reference-guide/configuring-infrastructure-components/event-processing/event-processors

https://docs.axoniq.io/reference-guide/extensions/kafka

Could you please guide me as to how I have events (stored in an RDBMS) replayed with Kafka? I’m not sure if there is any more config that needs to go in that hasn’t been mentioned in the docs.

Regards,
Mary

Forgot to mention that the Axon framework version that I’m using is 4.0, and axon-kafka-spring-boot-starter version is 4.0-RC

You need to do both delete the token-event-store and rename consumer-group to something like “name-v1” you will also want to set auto-offset-reset: earliest

Thank you Michael, having the offset reset property and changing the consumer group-id worked.

Regards,
Mary

Hello Mary,

I would like to emphasize that removing the token to trigger a replay is an old approach to resetting the stream for a given Tracking Event Processor.
It is far better to trigger the reset through the TrackingEventProcessor’s resetTokens() API.

This will give you the benefit that the framework actually knows it is replaying, which is also described here in the Reference Guide.

Just to repeat dropping/removing the token will not give the framework the knowledge a replay is happening.
It’ll just think the Tracking Event Processor is started for the first time.

Cheers,
Steven

Thank you Steven. TrackingEventProcessor’s API is definitely the clean way to go about it as you mentioned. I will try that out and will reach out in case of issues.

Regards,
Mary