Question: Can event_cb be called on a stopped producer/consumer?
Pilipets opened this issue · comments
Reading through https://github.com/confluentinc/librdkafka/blob/master/INTRODUCTION.md#threads-and-callbacks, I didn't find an answer to my question.
For a stopped producer/consumer, does anything happen in the librdkafka background threads to trigger event_cb being called?
I want to reuse one callback among N producers/consumers, so trying to understand the architecture.
Let's say a broker drops a client connection, will the reconnection attempt happen in the background thread or when I do poll/start for the respective producer/consumer?
I'm referring to the
ExampleEventCb ex_event_cb;
conf->set("event_cb", &ex_event_cb, errstr);
Ok, as far as I can see, the events need to be served manually by calling poll.
/**
- @brief Polls the provided kafka handle for events.
...
- @remark An application should make sure to call poll() at regular
-
intervals to serve any queued callbacks waiting to be called.
...
RD_EXPORT
int rd_kafka_poll(rd_kafka_t *rk, int timeout_ms);