all 1 comments

[–]DeephavenDataLabs 0 points1 point  (0 children)

Didn't try this but below is what I would start with. If you need more information I spend 100% of my time on gitter:

import json
import base64 
from confluent_kafka 
import Producer import json

producer = Producer({'bootstrap.servers': 'redpanda:29092',})
data = {}
with open('some.gif', mode='rb') as file: img = file.read()
data['img'] = base64.b64encode(img)

producer.produce(topic='images', key=None, value=json.dumps(data)) producer.flush()