-
Notifications
You must be signed in to change notification settings - Fork 917
add error_cb to confluent example #726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add error_cb to confluent example #726
Conversation
It looks like @naartjie hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here. Once you've signed reply with Appreciation of efforts, clabot |
[clabot:check] |
@confluentinc It looks like @naartjie just signed our Contributor License Agreement. 👍 Always at your service, clabot |
good idea! even better, it would be good to add the following note to the callback method so that people understand better what the error events are for (this creates a lot of confusion).
|
(but stick to 80 char wide limit - i don't think the above does) |
There is a bit of librdkafka nuance here: Another problem is that if you register an error_cb and call something blocking that is not poll(), such as metadata(), you will not get any error logs (because error_cb is set) and you wont get any error_cbs because you are not calling poll(). |
this is such a complicated arrangement to have exposed to the end user - no one is going to use this correctly - we need to simplify it. |
|
||
p = Producer({ | ||
'bootstrap.servers': '<ccloud bootstrap servers>', | ||
'sasl.mechanisms': 'PLAIN', | ||
'security.protocol': 'SASL_SSL', | ||
'sasl.username': '<ccloud key>', | ||
'sasl.password': '<ccloud secret>' | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may look a read a little easier if we set the error cb in the conf dict itself.
I think we should close this PR and fix so that the Producer does not set the C error_cb unless a Py error_cb is specified. This way librdkafka will log broker failures by default, and it wont require the application to provide an error_cb, nor poll() to have it triggered. |
Hi. I thought it might be handy to add the
error_cb
to the confluent example, in case someone else gets tripped up by errors getting swallowed up, like in #722.