Skip to content

ConsumerConnectionSubCommand needs 'brokerAddress' param #3890

@MatrixHB

Description

@MatrixHB

The command ConsumerConnectionSubCommand is used to query the connection of consumer and brokers, and it randomly selects one of all brokers to view the consumers who maintain the heartbeat with this broker.

        String topic = MixAll.getRetryTopic(consumerGroup);
        List<BrokerData> brokers = this.examineTopicRouteInfo(topic).getBrokerDatas();
// randomly select
        BrokerData brokerData = brokers.get(random.nextInt(brokers.size()));
        String addr = null;
        if (brokerData != null) {
            addr = brokerData.selectBrokerAddr();
            if (StringUtils.isNotBlank(addr)) {
                result = this.mqClientInstance.getMQClientAPIImpl().getConsumerConnectionList(addr, consumerGroup, timeoutMillis);
            }
        }

When one broker encounter network problem or FGC, the consumertable maintained locally by the broker does not conform to the reality. When this broker is randomly selected, it is determined that the consumer is "offline".

In order to more easily locate the broker with problems when facing such problems, the ConsumerConnection command needs to have a more specific '-b' parameter (not available at present).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions