%3|1681298110.812|FAIL|rdkafka#producer-1| [thrd:ubuntu22:9092/0]: ubuntu22:9092/0: Connect to ipv4#149.___.69.__:9092 failed: Unknown error (after 21059ms in state CONNECT)
from confluent_kafka import Producer
p = Producer({'bootstrap.servers': '192.168.0.34:9092'})
some_data_source = ['odin', 'dva', 'three']
def delivery_report(err, msg):
if err is not None:
print('Message delivery failed: {}'.format(err))
else:
print('Message delivered to {} [{}]'.format(msg.topic(), msg.partition()))
for data in some_data_source:
p.poll(0)
p.produce('TutorialTopic', data.encode('utf-8'), callback=delivery_report)
p.flush()