Skip to main content

Fetch Request only returning one message/batch

Hey everyone,

I am having some issues I am very confused about, and I hope someone can help me understand what I am doing wrong.

I use consecutive numbers as values for some messages. Those messages are then sent to Kafka via a Produce Request. The target topic has three partitions, and the messages are spread among them. When I issue a Fetch Request, there is always only one batch with one message returned. I also checked the latest offsets beforehand, and they show that there is more than one message inside the given partition.

Reading into the various settings, I also ensured that I have the following set in the Fetch request

*
fetch.min.bytes = 100 * 1024,
*
fetch.max.bytes = 1024 ** 2,
*
max.partition.fetch.bytes = 1024 ** 2,
*
fetch.max.wait.ms = 2000

Additionally, I have set

*
message.max.bytes = 1000012

As the messages are clearly much smaller than fetch.min.bytes, and they are already stored in the logs, I would expect to receive more than one message. I am not sure whether fetch.min.bytes relates to messages in a batch or to multiple batches, but in any case, both should yield more than one message/batch. Now I am very much out of ideas on what to do here.

I'm not sure if this is relevant, but I am using https://github.com/platformatic/kafka, and I can check there that the settings are indeed correctly set in the Fetch request to the Kafka node.

Thanks, Peter

Comments