Java Code Examples for com.alibaba.rocketmq.common.protocol.body.ConsumerRunningInfo#setStackTraceElementMap()
The following examples show how to use
com.alibaba.rocketmq.common.protocol.body.ConsumerRunningInfo#setStackTraceElementMap() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClientRemotingProcessor.java From reading-and-annotate-rocketmq-3.4.6 with GNU General Public License v3.0 | 6 votes |
private RemotingCommand getConsumerRunningInfo(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetConsumerRunningInfoRequestHeader requestHeader = (GetConsumerRunningInfoRequestHeader) request.decodeCommandCustomHeader(GetConsumerRunningInfoRequestHeader.class); ConsumerRunningInfo consumerRunningInfo = this.mqClientFactory.consumerRunningInfo(requestHeader.getConsumerGroup()); if (null != consumerRunningInfo) { if (requestHeader.isJstackEnable()) { Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces(); consumerRunningInfo.setStackTraceElementMap(map); String jstack = UtilAll.jstack(map); consumerRunningInfo.setJstack(jstack); } response.setCode(ResponseCode.SUCCESS); response.setBody(consumerRunningInfo.encode()); } else { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark(String.format("The Consumer Group <%s> not exist in this consumer", requestHeader.getConsumerGroup())); } return response; }
Example 2
Source File: ClientRemotingProcessor.java From rocketmq with Apache License 2.0 | 6 votes |
private RemotingCommand getConsumerRunningInfo(ChannelHandlerContext ctx, RemotingCommand request) throws RemotingCommandException { final RemotingCommand response = RemotingCommand.createResponseCommand(null); final GetConsumerRunningInfoRequestHeader requestHeader = (GetConsumerRunningInfoRequestHeader) request.decodeCommandCustomHeader(GetConsumerRunningInfoRequestHeader.class); ConsumerRunningInfo consumerRunningInfo = this.mqClientFactory.consumerRunningInfo(requestHeader.getConsumerGroup()); if (null != consumerRunningInfo) { if (requestHeader.isJstackEnable()) { Map<Thread, StackTraceElement[]> map = Thread.getAllStackTraces(); consumerRunningInfo.setStackTraceElementMap(map); String jstack = UtilAll.jstack(map); consumerRunningInfo.setJstack(jstack); } response.setCode(ResponseCode.SUCCESS); response.setBody(consumerRunningInfo.encode()); } else { response.setCode(ResponseCode.SYSTEM_ERROR); response.setRemark(String.format("The Consumer Group <%s> not exist in this consumer", requestHeader.getConsumerGroup())); } return response; }