Kafka Producer Strategies | Fire and Forget | Synchronous Send | Asynchronous Send with Callback

Опубликовано: 11 Декабрь 2022
на канале: ProgressiveCoder
1,874
29

Kafka Producer Strategies | Kafka Tutorial | Kafka Message Producing | Kafka Fire and Forget | Kafka Synchronous Send | Kafka Asynchronous Send | Kafka Producer Async Callback | Kafka Producer Sync vs Async | Kafka Producer Async Example

#Kafka #Microservices #KafkaTutorial

In this video, I talk about the three strategies for producing messages using the Kafka Producer. For all the strategies, we look at code examples in Java and Spring Boot.

The three strategies for producing messages are as follows

Fire and Forget - In this strategy, we send the messages to the broker and don’t care what happens after that.
Synchronous Send - In this strategy, we send the message and wait for a response from the Kafka Broker. The Future object contains the RecordMetadata information about the message
Asynchronous Send - In the asynchronous strategy, we attach a callback instance to the Kafka Producer’s send method. When the response is received, the callback is triggered with the record metadata information. In case of message failure, we get details of the error.

— TIMESTAMPS ⏰ —

00:00 - Intro
00:50 - Kafka Fire and Forget Strategy
02:42 - Kafka Synchronous Send Strategy
04:09 - Kafka Asynchronous Send Strategy

— Subscribe to the Newsletter ✉️ —

https://progressivecoder.substack.com/

— Connect with Me 🙌 —

TWITTER -   / progressivecod2  
LINKEDIN -   / saurabh-dashora-b3601173  
GITHUB - https://github.com/dashsaurabh

— Other Platforms 👇👇 —

ProgressiveCoder Blog - https://progressivecoder.com
ProgressiveWebNinja Blog - https://www.progressivewebninja.com
Hashnode - https://saurabhdashora.hashnode.dev/
Dev - https://dev.to/dashsaurabh