from kafka import KafkaConsumer

consumer = KafkaConsumer('sample', auto_offset_reset='earliest', group_id=None)
print('Starting Kafka Consumer')

# Recursively print all messages from Kafka Broker
for message in consumer:
    print(message)

from kafka import KafkaConsumer

consumer = KafkaConsumer('sample', auto_offset_reset='earliest', group_id=None)
print('Starting Kafka Consumer')

# Recursively print all messages from Kafka Broker
for message in consumer:
    print(message)

# Recursively print all messages from Kafka Broker