-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Want to make sure I'm using rd_kafka_poll correctly #71
Description
Hi,
I know we've discussed previously, but I want to make sure I'm using poll correctly. As I understand it, it will return when there is a delivery or error available. In my use case, I don't want to publish the next message unless I've received an acknowledgement for the prior message. I'm in the process of doing testing and am bringing down one of the brokers while publishing. I'm pretty sure there are cases where poll is returning >=1, simply because it called my error callback with a non fatal error (one of the brokers being unreachable). However, that also means that poll is returning, even though I haven't received an acknowledgement for my last message. That would seem to imply that I need to continue polling (in a loop) until I specifically get either a fatal error or an acknowledgement, since checking that poll had returned at least one event may not necessarily indicate that what I just produced() was either successful or failed (and the callbacks could all be just informational. Is this correct?
I'm seeing that multiple messages are 'outstanding' waiting for delivery callbacks, and in my case I should only ever have one outstanding.