When Kafka messages exceed the default 1 MB limit and hurt performance, the two main strategies are raising the configured message size limits or redesigning the producer to split large payloads into smaller chunks.
A service producing large image-processing payloads might switch to storing the actual file in object storage and publishing just the object's URL and metadata on the Kafka topic, keeping messages small while still giving consumers access to the full data.
# broker/topic config
message.max.bytes=5242880
# producer config
max.request.size=5242880
# consumer config
max.partition.fetch.bytes=5242880A concise interview answer is
I'd first ask whether the payload really needs to be in Kafka at all — often the better fix is a claim-check pattern where the large data goes to external storage and only a reference goes on the topic; if the message genuinely needs to stay in Kafka, I raise message.max.bytes and matching producer/consumer limits, understanding the throughput trade-off.
Last updated: 16 July 2026
Previous question: How would you handle a situation where Kafka is causing message duplication due to consumer rebalancing or producer retries?
Next question: How would you handle a situation where your Kafka consumer group is significantly lagging behind in consuming messages?