question came up during a design discussion for a new project.
There were two different points of view:
We should just forget about the event after publishing it to the broker.
We should make sure to get a confirmation that the broker received the event.
The problem, of course, is a game of trade-offs.
We were using Kafka for that project. And it turned out there were 3 options we could choose from:
Fire and Forget
Synchronous Send
Asynchronous Send
How Does the Kafka Producer Work?
Before we look at each option, let’s first understand how the Kafka Producer works.
In the first step, we create a ProducerRecord