InterviewSolution
Saved Bookmarks
| 1. |
How can Kafka producer maintain exactly once semantics? |
|
Answer» With Kafka messaging system, three DIFFERENT types of semantics can be achieved.
Kafka transactions help achieve exactly once semantic between Kafka brokers and clients. In order to achieve this we need to set below properties at producer end – enable.idempotence=true and transactional.ID=<some unique id>. We also need to call initTransaction to PREPARE the producer to use transactions. With these properties set, if the producer (characterized by producer id> accidentally sends the same message to Kafka more than once, then Kafka BROKER detects and de-duplicates it. |
|