I created a kafka setup using bitnami/kafka docker template. After recreating the containers multiple times (I wasn't able to connect to Kafka on 9092) I finally got my cluster up and running. I believe the problems were caused by the fact that Docker is intalled on Windows and not Linux.
My current problem is that I'm not able to consume any messages using the kafka-python library and the following piece of code:
from kafka import KafkaConsumer
from kafka import TopicPartition
print('Making connection.')
consumer = KafkaConsumer(bootstrap_servers='localhost:9092')
print('Assigning Topic.')
consumer.assign([TopicPartition('linuxhint', 2)])
print('Getting message.')
for message in consumer:
print("OFFSET: " + str(message[0])+ "\t MSG: " + str(message))
The code doesn't fail. It prints the "Getting message" line and doesn't finish. I tried consuming the same topic using the Conduktor app, and I can't do it either. Conduktor isn't even able to read the count and size of the topic. How can I troubleshoot it?