Last active
June 6, 2019 10:52
-
-
Save dvainrub/bd31433d1e2d2ee51433d318221719e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from kafka import KafkaProducer | |
from json import dumps | |
producer = KafkaProducer( | |
value_serializer=lambda m: dumps(m).encode('utf-8'), | |
bootstrap_servers=['172.17.0.1:32783','172.17.0.1:32782','172.17.0.1:32781']) | |
producer.send("test", value={"hello": "producer"}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment