python2.7怎么获取Kafka的topic?
python2.7怎么获取Kafka的topic?
from kafka import KafkaConsumer
consumer = KafkaConsumer('test',
bootstrap_servers=['172.21.10.136:9092'])
for message in consumer:
print ("%s:%d:%d: key=%s value=%s" % (message.topic, message.partition,
message.offset, message.key,