diff --git a/joyqueue-server/joyqueue-broker-core/src/main/java/org/joyqueue/broker/consumer/CasPartitionManager.java b/joyqueue-server/joyqueue-broker-core/src/main/java/org/joyqueue/broker/consumer/CasPartitionManager.java index 269bd56d3..669a18fe1 100644 --- a/joyqueue-server/joyqueue-broker-core/src/main/java/org/joyqueue/broker/consumer/CasPartitionManager.java +++ b/joyqueue-server/joyqueue-broker-core/src/main/java/org/joyqueue/broker/consumer/CasPartitionManager.java @@ -223,10 +223,16 @@ public boolean isRetry(Consumer consumer) throws JoyQueueException { Boolean retry = clusterManager.getConsumerPolicy(TopicName.parse(consumer.getTopic()), consumer.getApp()).getRetry(); List masterPartitionList = clusterManager.getLocalPartitions(TopicName.parse(consumer.getTopic())); - if (!retry.booleanValue() || !masterPartitionList.contains((short) 0)) { + + if (!retry) { logger.debug("retry enable is false."); return false; } + if (randomBound == 1) { + return true; + } else if (!masterPartitionList.contains((short) 0)) { + return false; + } int val = random.nextInt(randomBound); // 重试管理中获取从重试分区消费的概率