欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

Pythonkafka

时间:2023-07-15
安装

pip3 install kafka-python

参考

Kafka Python client
https://github.com/dpkp/kafka-python

Python 连接 Kafka 简单实现
https://www.jianshu.com/p/2ae9b2608ae1

kafka使用_kafka-python基本使用
https://blog.csdn.net/weixin_39963534/article/details/110802374

MessageSizeTooLargeException

Consumer side:fetch.message.max.bytes - this will determine the largest size of a message that can be fetched by the consumer.Broker side: replica.fetch.max.bytes - this will allow for the replicas in the brokers to send messages within the cluster and make sure the messages are replicated correctly、If this is too small, then the message will never be replicated, and therefore, the consumer will never see the message because the message will never be committed (fully replicated).Broker side: message.max.bytes - this is the largest size of the message that can be received by the broker from a producer.Broker side (per topic): max.message.bytes - this is the largest size of the message the broker will allow to be appended to the topic、This size is validated pre-compression、(Defaults to broker’s message.max.bytes.)

如果主题已经创建,修改主题参数

查看参数

bin/kafka-configs.sh --all --describe --topic test-video --bootstrap-server localhost:9092

max.message.bytes=1048588 sensitive=false synonyms={DEFAULT_CONFIG:message.max.bytes=1048588}

修改参数 改为大小约10M

bin/kafka-configs.sh --alter --topic test-video --add-config max.message.bytes=10485880 --bootstrap-server localhost:9092

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。