Commit 99e8021d authored by 赵威's avatar 赵威

get data

parent dabe6dd9
from kafka import KafkaConsumer
import json
def consume_kafka():
......@@ -9,10 +10,9 @@ def consume_kafka():
consumer.subscribe(["gm-portrait-update-device"])
message = consumer.consume_data()
for msg in message:
for msg in consumer:
print(msg.value)
print(json.loads(msg.value), "\n")
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment