Question: Does node-rdkafka support asynchronous produce?
It is more of a question and not a bug report. I was looking at the Producer documentation and the documentation for produce says that it produces messages to kafka synchronously.
Is asynchronous produce not support? If it is how can i achieve it, I didn't find any example in docs.
Thanks!
All produce methods are async in a sense that the message is not synchronously written to Kafka but just queued into a buffer. If you need callback when your message gets to the Kafka you can use HighLevelProducer and its produce method.
Then why does the documentation says it produces messages synchronously.
Copied from https://blizzard.github.io/node-rdkafka/current/Producer.html
produce(topic, partition, message, key, timestamp, opaque) → {boolean} Produce a message to Kafka synchronously. This is the method mainly used in this class. Use it to produce a message to Kafka. The first and only parameter of the synchronous variant is the message object. When this is sent off, there is no guarantee it is delivered. If you need guaranteed delivery, change your acks settings, or use delivery reports.
I'm not sure what that is but the only valid and maintained documentation is README.md