Search in sources :

Example 6 with GetConsumerStatusBody

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

the class ClientRemotingProcessor method getConsumeStatus.

@Deprecated
public RemotingCommand getConsumeStatus(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException {
    final RemotingCommand response = RemotingCommand.createResponseCommand(null);
    final GetConsumerStatusRequestHeader requestHeader = (GetConsumerStatusRequestHeader) request.decodeCommandCustomHeader(GetConsumerStatusRequestHeader.class);
    Map<MessageQueue, Long> offsetTable = this.mqClientFactory.getConsumerStatus(requestHeader.getTopic(), requestHeader.getGroup());
    GetConsumerStatusBody body = new GetConsumerStatusBody();
    body.setMessageQueueTable(offsetTable);
    response.setBody(body.encode());
    response.setCode(ResponseCode.SUCCESS);
    return response;
}
Also used : RemotingCommand(org.apache.rocketmq.remoting.protocol.RemotingCommand) MessageQueue(org.apache.rocketmq.common.message.MessageQueue) GetConsumerStatusBody(org.apache.rocketmq.common.protocol.body.GetConsumerStatusBody) GetConsumerStatusRequestHeader(org.apache.rocketmq.common.protocol.header.GetConsumerStatusRequestHeader)

Aggregations

GetConsumerStatusBody (org.apache.rocketmq.common.protocol.body.GetConsumerStatusBody)6 GetConsumerStatusRequestHeader (org.apache.rocketmq.common.protocol.header.GetConsumerStatusRequestHeader)6 RemotingCommand (org.apache.rocketmq.remoting.protocol.RemotingCommand)6 MessageQueue (org.apache.rocketmq.common.message.MessageQueue)4 Channel (io.netty.channel.Channel)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 ConcurrentMap (java.util.concurrent.ConcurrentMap)2 ClientChannelInfo (org.apache.rocketmq.broker.client.ClientChannelInfo)2 MQClientException (org.apache.rocketmq.client.exception.MQClientException)2 RemotingSendRequestException (org.apache.rocketmq.remoting.exception.RemotingSendRequestException)2 RemotingTimeoutException (org.apache.rocketmq.remoting.exception.RemotingTimeoutException)2