Skip to content

Commit

Permalink
Merge pull request #302 from minusmajun/master
Browse files Browse the repository at this point in the history
重试队列拉取比率过低问题
  • Loading branch information
llIlll committed Sep 7, 2020
2 parents dcf7feb + 55b44d7 commit 0919c12
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,16 @@ public boolean isRetry(Consumer consumer) throws JoyQueueException {

Boolean retry = clusterManager.getConsumerPolicy(TopicName.parse(consumer.getTopic()), consumer.getApp()).getRetry();
List<Short> 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);
// 重试管理中获取从重试分区消费的概率
Expand Down

0 comments on commit 0919c12

Please sign in to comment.