I'm trying to consume messages from a Kafka topic. I'm using a wrapper around confluent_kafka
consumer. I need to check if connection is established before I start consuming messages.
I read that the consumer is lazy, so I need to perform some action for the connection to get established. But I want to check the connection establishment without doing a consume
or poll
operation.
Also, I tried giving some bad configurations to see what the response on a poll would be. The response I got was:
b'Broker: No more messages'
So, how do I decide if the connection parameters are faulty, the connection is broken, or there actually are no messages in the topic?