diff --git a/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java b/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java index f2abdba74c2..a1afe7e57e3 100644 --- a/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java +++ b/broker/src/main/java/org/apache/rocketmq/broker/metrics/ConsumerLagCalculator.java @@ -177,12 +177,14 @@ private void processAllGroup(Consumer consumer) { if (isPop) { String retryTopic = KeyBuilder.buildPopRetryTopic(topic, group); TopicConfig retryTopicConfig = topicConfigManager.selectTopicConfig(retryTopic); - int retryTopicPerm = retryTopicConfig.getPerm() & brokerConfig.getBrokerPermission(); - if (PermName.isReadable(retryTopicPerm) || PermName.isWriteable(retryTopicPerm)) { - consumer.accept(new ProcessGroupInfo(group, topic, true, retryTopic)); - } else { - consumer.accept(new ProcessGroupInfo(group, topic, true, null)); + if (retryTopicConfig != null) { + int retryTopicPerm = retryTopicConfig.getPerm() & brokerConfig.getBrokerPermission(); + if (PermName.isReadable(retryTopicPerm) || PermName.isWriteable(retryTopicPerm)) { + consumer.accept(new ProcessGroupInfo(group, topic, true, retryTopic)); + continue; + } } + consumer.accept(new ProcessGroupInfo(group, topic, true, null)); } else { consumer.accept(new ProcessGroupInfo(group, topic, false, null)); }