from confluent_kafka import Consumer, KafkaError
import logging
logging.basicConfig(level=logging.DEBUG)
conf = {
‘bootstrap.servers’: ‘ip:9092’,
‘group.id’: ‘test-consumer89-grokkkup’,
‘enable.auto.commit’: True,
‘auto.offset.reset’: ‘earliest’
}
consumer = Consumer(conf)
consumer.subscribe([‘study1’])
while True:
msg = consumer.poll(1.0)
if msg is None:
continue
if msg.error():
if msg.error().code() == KafkaError._PARTITION_EOF:
print('End of partition reached')
else:
print('Error while consuming message: {}'.format(msg.error()))
else:
print('Received message: {}'.format(msg.value().decode('utf-8')))
using this code I am unable to consume msg . connetion is accepted but not getting any msg even in topic msg is there