Skip to content

Admin subcommand consumeMessage should quit when catch exception #377

@xiaozongyang

Description

@xiaozongyang

BUG REPORT

Problem Description

When I use the admin command mqadmin consumeMessage -t TestTopic I got the MQClientException with a message "Can not find Message Queue for this topic, TestTopic", the full stack trace is

org.apache.rocketmq.client.exception.MQClientException: Can not find Message Queue for this topic, TestTopic
See http://rocketmq.apache.org/docs/faq/ for further details.
        at org.apache.rocketmq.client.impl.MQAdminImpl.fetchSubscribeMessageQueues(MQAdminImpl.java:162)
        at org.apache.rocketmq.client.impl.consumer.DefaultMQPullConsumerImpl.fetchSubscribeMessageQueues(DefaultMQPullConsumerImpl.java:136)
        at org.apache.rocketmq.client.consumer.DefaultMQPullConsumer.fetchSubscribeMessageQueues(DefaultMQPullConsumer.java:225)
        at org.apache.rocketmq.tools.command.message.ConsumeMessageCommand.executeDefault(ConsumeMessageCommand.java:237)
        at org.apache.rocketmq.tools.command.message.ConsumeMessageCommand.execute(ConsumeMessageCommand.java:182)
        at org.apache.rocketmq.tools.command.MQAdminStartup.main0(MQAdminStartup.java:132)
        at org.apache.rocketmq.tools.command.MQAdminStartup.main(MQAdminStartup.java:83)
Caused by: org.apache.rocketmq.client.exception.MQClientException: CODE: 17  DESC: No topic route info in name server for the topic: TestTopic
See http://rocketmq.apache.org/docs/faq/ for further details.
        at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1232)
        at org.apache.rocketmq.client.impl.MQClientAPIImpl.getTopicRouteInfoFromNameServer(MQClientAPIImpl.java:1202)
        at org.apache.rocketmq.client.impl.MQAdminImpl.fetchSubscribeMessageQueues(MQAdminImpl.java:151)
        ... 6 more

but the mqadmin command hangs up and doesn't quit as expected.

Environment Details

  • OS: OSX El Caption Version 10.11.6
  • Java version: 1.8.0_172
  • RocketMQ version: 4.2.0

FIX suggestion

the mqadmin command should quit when catching an exception

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions