Python 官方文档:入门教程 => 点击学习
https://blog.csdn.net/see_you_see_me/article/details/78468421Https://zhuanlan.zhihu.com/p/38330574from kafka import Kafk
https://blog.csdn.net/see_you_see_me/article/details/78468421
Https://zhuanlan.zhihu.com/p/38330574
from kafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers=['10.17.2.11:×××'],value_serializer=lambda v: JSON.dumps(v).encode('utf-8'), security_protocol="SASL_PLAINTEXT", sasl_mechanism='PLAIN', sasl_plain_username='username', sasl_plain_passWord='passwd')
producer.send('topic', {'envtype': 'envtype', 'servicename': 'servicename', 'handleinfo': 'handleinfo'})
--结束END--
本文标题: python连接kafka
本文链接: https://lsjlt.com/news/190704.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0