Skip to content

Commit

Permalink
通过设置rondom=1来使主题其他broker也可以拉到重试队列消息
Browse files Browse the repository at this point in the history
  • Loading branch information
majun87 committed Sep 6, 2020
1 parent dcf7feb commit 7d771cb
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,20 @@ 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;
}
/*if (!retry.booleanValue() || !masterPartitionList.contains((short) 0)) {
logger.debug("retry enable is false.");
return false;
}*/

int val = random.nextInt(randomBound);
// 重试管理中获取从重试分区消费的概率
Expand Down

0 comments on commit 7d771cb

Please sign in to comment.