Open
Description
Description
from confluent_kafka import Consumer
conf = {
'bootstrap.servers': 'localhost:8082',
'group.id': 'myconsumer',
'security.protocol': 'sasl_ssl',
'sasl.mechanism': 'PLAIN',
'sasl.username': 'myusername',
'sasl.password': 'badpassword'
}
consumer = Consumer(conf)
Invoking the code above with an incorrect password does not raise any error. It seems like it asynchronously attempts to authorize, and after a few seconds a separate thread will print the following to the screen:
%3|1658355875.069|FAIL|rdkafka#consumer-1| [thrd:sasl_ssl://localhost:9092/boots]: sasl_ssl://localhost:9092/bootstrap: SASL authentication error: Authentication failed (after 5170ms in state AUTH_REQ, 5 identical error(s) suppressed)
If I then subscribe to a topic and poll, on_assign is never called and the message is never polled.
How do I figure out if I've been correctly authorized?
Would it perhaps be better if it raised a synchronous exception?
Checklist
Please provide the following information:
-
confluent-kafka-python and librdkafka version (
confluent_kafka.version()
andconfluent_kafka.libversion()
):1.8.2 and 1.8.2