Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to examine pop consumer group status/progress/connection, no topic route for retry topic #5844

Closed
HScarb opened this issue Jan 9, 2023 · 6 comments

Comments

@HScarb
Copy link
Contributor

HScarb commented Jan 9, 2023

  1. Please describe the issue you observed:
  • What did you do (The steps to reproduce)?

    1. Use pop consume API MQClientAPIImpl.popMessageAsync to pop a message from topic
    2. Use MQAdmin consumerProgress/consumerStatus/consumerConnection command to examine pop consumer stats
  • What is expected to see?

Consumer stats returns properly

  • What did you see instead?
MQClientException: CODE: 17  DESC: No topic route info in name server for the topic: %RETRY%cid-test

image

  1. Please tell us about your environment:

Rocketmq 5.0.1-snapshot, latest develop branch

  1. Other information (e.g. detailed explanation, logs, related issues, suggestions on how to fix, etc):

consumerProgress/consumerStatus/consumerConnection
These three commands both build and examine route info for normal retry topic of pop consumer, that's where the exception raises, as pop consumer won't create a normal retry topic.

image


I didn't come up with a perfect solution for this issue, but I have several approches

  1. Build a dummy retry topic when a consumer call pop API for the first time.
  2. Catch the exception raised by examineTopicRouteInfo, so the MQAdmin commands would execute without exception
@HScarb HScarb added the type/bug label Jan 9, 2023
@ni-ze
Copy link
Contributor

ni-ze commented Jan 10, 2023

IMO, I think neither are good solution. Use retry topic just want to find the broker address. Maybe we can solve like this:

Collection<BrokerData> values = this.examineBrokerClusterInfo().getBrokerAddrTable().values();
        for (BrokerData value : values) {
            String addr = value.selectBrokerAddr();
            if (StringUtils.isNotBlank(addr)) {
                ConsumerConnection result = this.mqClientInstance.getMQClientAPIImpl().getConsumerConnectionList(addr, consumerGroup, timeoutMillis);
                if (result != null) {
                    return result;
                }
            }
        }

@ShadowySpirits
Copy link
Member

The broker creates the retry topic automatically when a consumer first sends a heartbeat.

see ClientManageProcessor#heartBeat:

String newTopic = MixAll.getRetryTopic(consumerData.getGroupName());
this.brokerController.getTopicConfigManager().createTopicInSendMessageBackMethod(
newTopic,
subscriptionGroupConfig.getRetryQueueNums(),
PermName.PERM_WRITE | PermName.PERM_READ, hasOrderTopicSub, topicSysFlag);
}

@RongtongJin
Copy link
Contributor

  1. MQClientAPIImpl.popMessageAsync

It seems that MQClientAPIImpl.popMessageAsync was directly called, resulting in no heartbeat being sent and no retry topic being created.

@xdkxlk
Copy link
Contributor

xdkxlk commented Jan 11, 2023

The command like consumerProgress can set the topic name to avoid this problem by -t, in the short term.

Copy link

This issue is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs.

@github-actions github-actions bot added the stale label Jan 12, 2024
Copy link

This issue was closed because it has been inactive for 3 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants