1 min readMay 31, 2019
Hi Gitesh. Sorry for the delayed response. You can send message asynchronously using the send() method:
producer.send(new ProducerRecord<>(topic, payload));
If you want to send messages synchronously, you can call the .get() method on the .send() method:
producer.send(new ProducerRecord<>(topic, payload)).get();