confluent-kafka-python
confluent-kafka-python copied to clipboard
AttributeError: 'NoneType' object has no attribute value
I am simply trying to read messages from Kafka partition in a topic. Here is my code:
partition = 1
par=1
#msg = consumer.poll(1.0)
partition = TopicPartition(topic, partition)
consumer.assign([partition])
offset_tuple=consumer.get_watermark_offsets(partition)
offset=offset_tuple[0]
print(offset)
#print(consumer.get_watermark_offsets(partition)[0])
partition1 = TopicPartition(topic, par,offset)
consumer.assign([partition1])
consumer.seek(partition1)
print(consumer.position([partition1]) )
msg = consumer.poll(1000000000.0)
print(msg.value())
I get an error - AttributeError: 'NoneType' object has no attribute value I am using kafka python version 1.6.0 @edenhill and others, Can someone help me please? I am not sure why I am getting this error message?
consumer.poll returns None on timeout. Can you make sure that there are messages in the topic and you are not hitting the timeout?
@srinivas1012 wanted to follow up based on @pranavrth 's last comment, is this still an issue you are facing? If not please advise so we can close this issue