Cucumber/GreenhouseManager/manager.py
2024-10-29 16:07:02 +04:00

17 lines
421 B
Python

from kafka import KafkaProducer, KafkaConsumer
import kafka
import socket
from json import dumps, loads
import time
dataConsumer = KafkaConsumer(
'data',
bootstrap_servers=['localhost:9092'],
auto_offset_reset='earliest',
enable_auto_commit=True,
group_id='my-group',
value_deserializer=lambda x: loads(x.decode('utf-8')))
while True:
for message in dataConsumer:
print(message)