This is an automated email from the ASF dual-hosted git repository.

lollipop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new e97a2cdb [ISSUE #1196] [Java] Increase max cached message count limit 
for PushConsumer (#1214)
e97a2cdb is described below

commit e97a2cdb41ca3447efcaa6bd78d4d75fd19445f3
Author: lizhimins <[email protected]>
AuthorDate: Fri Mar 27 16:13:16 2026 +0800

    [ISSUE #1196] [Java] Increase max cached message count limit for 
PushConsumer (#1214)
---
 .../client/java/impl/consumer/PushConsumerBuilderImpl.java        | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerBuilderImpl.java
 
b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerBuilderImpl.java
index 0d833bfc..e384a867 100644
--- 
a/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerBuilderImpl.java
+++ 
b/java/client/src/main/java/org/apache/rocketmq/client/java/impl/consumer/PushConsumerBuilderImpl.java
@@ -38,7 +38,13 @@ public class PushConsumerBuilderImpl implements 
PushConsumerBuilder {
     private String consumerGroup = null;
     private Map<String, FilterExpression> subscriptionExpressions = new 
ConcurrentHashMap<>();
     private MessageListener messageListener = null;
-    private int maxCacheMessageCount = 1024;
+
+    /**
+     * The number of cached messages should not be set too high, as the 
consumption
+     * timeout is calculated from the moment the message is pulled from the 
server.
+     * However, in scenarios with a large number of brokers, the maximum 
throughput may not be achievable.
+     */
+    private int maxCacheMessageCount = 4096;
     private int maxCacheMessageSizeInBytes = 64 * 1024 * 1024;
     private int consumptionThreadCount = 20;
     private boolean enableFifoConsumeAccelerator = false;

Reply via email to