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
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