Commit 3b7cb157 authored by 赵威's avatar 赵威

get data

parent 99e8021d
...@@ -11,8 +11,9 @@ def consume_kafka(): ...@@ -11,8 +11,9 @@ def consume_kafka():
consumer.subscribe(["gm-portrait-update-device"]) consumer.subscribe(["gm-portrait-update-device"])
for msg in consumer: for msg in consumer:
print(msg.value) data = json.loads(msg.value)
print(json.loads(msg.value), "\n") device_id = data.get("device_id", "")
print(device_id)
if __name__ == "__main__": 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