-
Notifications
You must be signed in to change notification settings - Fork 922
Closed
Description
Description
I am trying to connect to confluent cloud hosted in Azure and consume the messages but on running the python code it give me the below error which I am unable to gauge.
2022-12-12 11:37:16,249 ERROR FAIL [python-example-consumer#consumer-1] [thrd:sasl_ssl://<NAME>.eastus.azure.confluent.cloud:9093/bootstra]: sasl_ssl://<NAME>.eastus.azure.confluent.cloud:9093/bootstrap: Connect to ipv4#20.XXX.XXX.XXX:9093 failed: Unknown error (after 21236ms in state CONNECT, 2 identical error(s) suppressed)
How do I check out the identical errors that are suppressed?
These are my configurations for consumer:
conf = {
'bootstrap.servers': '<NAME>.eastus.azure.confluent.cloud:9093',
'security.protocol': 'SASL_SSL',
'sasl.mechanism': 'PLAIN',
'sasl.username': client_key,
'sasl.password': client_secret,
'group.id': 'consumer1',
'client.id': 'python-example-consumer',
'session.timeout.ms': 60000,
'default.topic.config': {'auto.offset.reset': 'smallest'}
}
Testing out with confluent-kafka=1.9.2
How to reproduce
c = Consumer(conf)
c.subscribe([topic])
try:
while True:
msg = c.poll(timeout=200.0)
if msg is None:
continue
if msg.error():
# Error or event
if msg.error().code() == KafkaError._PARTITION_EOF:
# End of partition event
sys.stderr.write('%% %s [%d] reached end at offset %d\n' %
(msg.topic(), msg.partition(), msg.offset()))
else:
# Error
raise KafkaException(msg.error())
else:
print(msg.value())
except KeyboardInterrupt:
print('\nAborted by user\n')
finally:
c.close()
Metadata
Metadata
Assignees
Labels
No labels