1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| consumer = KafkaConsumer('topic1', auto_offset_reset='earliest', enable_auto_commit=False, bootstrap_servers=['192.168.56.12:9092'])
for message in consumer: print ("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition, message.offset, message.key, message.value))
topic1:0:0: key=None value=b'11-16-19:11-2016-00' topic1:0:1: key=None value=b'11-16-19:11-2016-02' topic1:0:2: key=None value=b'11-16-19:11-2016-03' topic1:0:3: key=None value=b'11-16-19:11-2016-03' topic1:0:4: key=None value=b'2016-11-19:11-05-1479524731'
|