Search in sources :

Example 16 with GroupList

use of org.apache.rocketmq.common.protocol.body.GroupList in project rocketmq by apache.

the class MQClientAPIImpl method queryTopicConsumeByWho.

public GroupList queryTopicConsumeByWho(final String addr, final String topic, final long timeoutMillis) throws RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException, InterruptedException, MQBrokerException {
    QueryTopicConsumeByWhoRequestHeader requestHeader = new QueryTopicConsumeByWhoRequestHeader();
    requestHeader.setTopic(topic);
    RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.QUERY_TOPIC_CONSUME_BY_WHO, requestHeader);
    RemotingCommand response = this.remotingClient.invokeSync(MixAll.brokerVIPChannel(this.clientConfig.isVipChannelEnabled(), addr), request, timeoutMillis);
    switch(response.getCode()) {
        case ResponseCode.SUCCESS:
            {
                GroupList groupList = GroupList.decode(response.getBody(), GroupList.class);
                return groupList;
            }
        default:
            break;
    }
    throw new MQBrokerException(response.getCode(), response.getRemark());
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) GroupList(org.apache.rocketmq.common.protocol.body.GroupList) QueryTopicConsumeByWhoRequestHeader(org.apache.rocketmq.common.protocol.header.QueryTopicConsumeByWhoRequestHeader) MQBrokerException(org.apache.rocketmq.client.exception.MQBrokerException)

Aggregations

GroupList (org.apache.rocketmq.common.protocol.body.GroupList)16 MQClientException (org.apache.rocketmq.client.exception.MQClientException)7 MQBrokerException (org.apache.rocketmq.client.exception.MQBrokerException)6 RemotingException (org.apache.rocketmq.remoting.exception.RemotingException)6 ArrayList (java.util.ArrayList)4 ConsumeStats (org.apache.rocketmq.common.admin.ConsumeStats)4 TopicList (org.apache.rocketmq.common.protocol.body.TopicList)4 QueryTopicConsumeByWhoRequestHeader (org.apache.rocketmq.common.protocol.header.QueryTopicConsumeByWhoRequestHeader)4 BrokerData (org.apache.rocketmq.common.protocol.route.BrokerData)4 RemotingCommand (org.apache.rocketmq.remoting.protocol.RemotingCommand)4 SubCommandException (org.apache.rocketmq.tools.command.SubCommandException)4 BrokerStatsData (org.apache.rocketmq.common.protocol.body.BrokerStatsData)3 ConsumerConnection (org.apache.rocketmq.common.protocol.body.ConsumerConnection)3 SubscriptionData (org.apache.rocketmq.common.protocol.heartbeat.SubscriptionData)3 TopicRouteData (org.apache.rocketmq.common.protocol.route.TopicRouteData)3 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 Field (java.lang.reflect.Field)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 List (java.util.List)2