Hi Alexey,
This somewhat depends on your set up, but let's assume you're using the default provided approach.
Thus, you're using the latest
Axon Framework release (4.1.2) with default settings, storing the events in Axon Server / a RDBMS solution.
Additionally, you've wired up the
Axon Kafka Extension (4.0-RC2, thus not a final release yet), utilizing the `KafkaPublisher` it provides to publish the events.
If this is the case, then Axon will make sure that when you publish an event, that it will always first be stored in the Axon Server or in to your RDBMS solution.
The `KafkaPublisher` uses once such SubscribableMessageSource to subscribe it self to that source, aka the Event Bus.
Now, when it comes to duplicates, the Event Store will ensure you that duplicate events cannot be stored.
As storage will come prior to publication, you are thus ensured that you do not have duplicates on your Kafka topic.
When it comes to event loss, there is one scenario imaginable that this might occur, and that is when the SubscribableMessageSource errors out upon providing the event or when the KafkaPublisher fails internally in one way or another.
The SubscribableMessageSource will only receive the message once it occurs and does not keep track which have been dealt with.
Thus ending up in an exceptional state will cause a loss of the event.
The changes of this occurring are however infrastructure configuration related I think.
The default SubscribableMessageSource, thus the Event Bus, will very, very likely not be the culprit when this occurs.
Instead, I'd assume this happens only when the KafkaPublisher fails to publish on the topic.
And if this is the case, I'd check whether the topic has been configured correctly.
Hope this sheds some light on the situation for you Alexey!
Cheers,
Steven