You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tubemq.apache.org by yu...@apache.org on 2021/01/29 10:07:08 UTC

[incubator-tubemq] 10/49: [TUBEMQ-445]Adjust the status check default sleep interval of pullConsumeReadyChkSliceMs (#345)

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

yuanbo pushed a commit to branch TUBEMQ-421
in repository https://gitbox.apache.org/repos/asf/incubator-tubemq.git

commit 7a1d7cba35fe8b60cb2767ee11e7d5d1138fdaae
Author: gosonzhang <46...@qq.com>
AuthorDate: Wed Dec 9 18:25:03 2020 +0800

    [TUBEMQ-445]Adjust the status check default sleep interval of pullConsumeReadyChkSliceMs (#345)
    
    Co-authored-by: gosonzhang <go...@tencent.com>
---
 .../main/java/org/apache/tubemq/client/common/TClientConstants.java   | 2 +-
 .../org/apache/tubemq/client/consumer/SimplePullMessageConsumer.java  | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/tubemq-client/src/main/java/org/apache/tubemq/client/common/TClientConstants.java b/tubemq-client/src/main/java/org/apache/tubemq/client/common/TClientConstants.java
index 36808c0..044fa17 100644
--- a/tubemq-client/src/main/java/org/apache/tubemq/client/common/TClientConstants.java
+++ b/tubemq-client/src/main/java/org/apache/tubemq/client/common/TClientConstants.java
@@ -25,7 +25,7 @@ public class TClientConstants {
     public static final long CFG_DEFAULT_REGFAIL_WAIT_PERIOD_MS = 1000;
     public static final long CFG_DEFAULT_MSG_NOTFOUND_WAIT_PERIOD_MS = 400L;
     public static final long CFG_DEFAULT_CONSUME_READ_WAIT_PERIOD_MS = 90000L;
-    public static final long CFG_DEFAULT_CONSUME_READ_CHECK_SLICE_MS = 300L;
+    public static final long CFG_DEFAULT_CONSUME_READ_CHECK_SLICE_MS = 50L;
     public static final long CFG_DEFAULT_PUSH_LISTENER_WAIT_PERIOD_MS = 3000L;
     public static final long CFG_DEFAULT_PULL_REB_CONFIRM_WAIT_PERIOD_MS = 3000L;
     public static final long CFG_DEFAULT_PULL_PROTECT_CONFIRM_WAIT_PERIOD_MS = 60000L;
diff --git a/tubemq-client/src/main/java/org/apache/tubemq/client/consumer/SimplePullMessageConsumer.java b/tubemq-client/src/main/java/org/apache/tubemq/client/consumer/SimplePullMessageConsumer.java
index b0fc8b9..6c1146d 100644
--- a/tubemq-client/src/main/java/org/apache/tubemq/client/consumer/SimplePullMessageConsumer.java
+++ b/tubemq-client/src/main/java/org/apache/tubemq/client/consumer/SimplePullMessageConsumer.java
@@ -147,7 +147,9 @@ public class SimplePullMessageConsumer implements PullMessageConsumer {
                     baseConsumer.getConsumerConfig().getPullConsumeReadyWaitPeriodMs())) {
                 return new ConsumerResult(selectResult.getErrCode(), selectResult.getErrMsg());
             }
-            ThreadUtils.sleep(baseConsumer.getConsumerConfig().getPullConsumeReadyChkSliceMs());
+            if (baseConsumer.getConsumerConfig().getPullConsumeReadyChkSliceMs() > 10) {
+                ThreadUtils.sleep(baseConsumer.getConsumerConfig().getPullConsumeReadyChkSliceMs());
+            }
         }
         StringBuilder sBuilder = new StringBuilder(512);
         // Check the data cache first