The message is xxx bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.
org.apache.kafka.common.errors.RecordTooLargeException: The message is xxxx bytes when serialized which is larger than the maximum request size you have configured with the max.request.size configuration.
How to fix this when you are using confluent Kafka docker.
1 2 3 4 5 6 7 |
cc-bhp-kafka: image: cp-kafka:5.0.3 environment: KAFKA_MESSAGE_MAX_BYTES: 15728640 # set message.max.bytes to 15MB KAFKA_MAX_REQUEST_SIZE: 15728640 # set max.request.size to 15MB KAFKA_PRODUCER_MAX_REQUEST_SIZE: 15728640 # set producer max.request.size to 15MB CONNECT_PRODUCER_MAX_REQUEST_SIZE: 15728640 # set producer max.request.size to 15MB |
Ref:
https://github.com/confluentinc/cp-docker-images/issues/445