GitHub user Polaris999 created a discussion: Why is 
MAX_MSG_NUMS_FOR_POP_REQUEST Hard-Limited to 32 in Proxy? Can It Be Made 
Configurable?

I am using RocketMQ 5.x with SimpleConsumer (POP).
While testing batch consumption, I found that even if the client sets a higher 
maxMessageNum (e.g. 128 or 256), the Proxy will always override it to 32.

The related code is in ProxyUtils:
```

if (maxMsgNums > ProxyUtils.MAX_MSG_NUMS_FOR_POP_REQUEST) {
    log.warn("change maxNums from {} to {} for pop request, with info: 
topic:{}, group:{}",
        maxMsgNums, ProxyUtils.MAX_MSG_NUMS_FOR_POP_REQUEST, topic, 
consumerGroup);
    maxMsgNums = ProxyUtils.MAX_MSG_NUMS_FOR_POP_REQUEST;
}
```

And MAX_MSG_NUMS_FOR_POP_REQUEST is hard-coded as:

`public static final int MAX_MSG_NUMS_FOR_POP_REQUEST = 32;`

❓My Questions
Why is POP batch size strictly limited to 32?
What is the design consideration?
Is it related to POP buffer, invisible time window, lock contention, or memory 
pressure?

Could this value be made configurable (e.g., via system property / proxy config 
/ environment variable), instead of a hard constant?

💡 Use Case

We have scenarios where:

- Each message is very small

- POP consumer concurrency is already well-scaled

- Pulling only 32 messages per batch significantly limits throughput

- Increasing batch size (e.g., 64 or 128) would greatly reduce broker 
round-trips and increase consumption efficiency

Thank you very much for your work and support!

GitHub link: https://github.com/apache/rocketmq/discussions/9920

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to