public TopicList getSystemTopicList( final long timeoutMillis) throws RemotingException, MQClientException, InterruptedException { RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_SYSTEM_TOPIC_LIST_FROM_NS, null); RemotingCommand response = this.remotingClient.invokeSync(null, request, timeoutMillis); assert response != null; switch (response.getCode()) { case ResponseCode.SUCCESS: { byte[] body = response.getBody(); if (body != null) { TopicList topicList = TopicList.decode(response.getBody(), TopicList.class); if (topicList.getTopicList() != null && !topicList.getTopicList().isEmpty() && !UtilAll.isBlank(topicList.getBrokerAddr())) { TopicList tmp = getSystemTopicListFromBroker(topicList.getBrokerAddr(), timeoutMillis); if (tmp.getTopicList() != null && !tmp.getTopicList().isEmpty()) { topicList.getTopicList().addAll(tmp.getTopicList()); } } return topicList; } } default: break; } throw new MQClientException(response.getCode(), response.getRemark()); }
public TopicList getSystemTopicList( final long timeoutMillis) throws RemotingException, MQClientException, InterruptedException { RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_SYSTEM_TOPIC_LIST_FROM_NS, null); RemotingCommand response = this.remotingClient.invokeSync(null, request, timeoutMillis); assert response != null; switch (response.getCode()) { case ResponseCode.SUCCESS: { byte[] body = response.getBody(); if (body != null) { TopicList topicList = TopicList.decode(response.getBody(), TopicList.class); if (topicList.getTopicList() != null && !topicList.getTopicList().isEmpty() && !UtilAll.isBlank(topicList.getBrokerAddr())) { TopicList tmp = getSystemTopicListFromBroker(topicList.getBrokerAddr(), timeoutMillis); if (tmp.getTopicList() != null && !tmp.getTopicList().isEmpty()) { topicList.getTopicList().addAll(tmp.getTopicList()); } } return topicList; } } default: break; } throw new MQClientException(response.getCode(), response.getRemark()); }
public TopicList getSystemTopicList( final long timeoutMillis) throws RemotingException, MQClientException, InterruptedException { RemotingCommand request = RemotingCommand.createRequestCommand(RequestCode.GET_SYSTEM_TOPIC_LIST_FROM_NS, null); RemotingCommand response = this.remotingClient.invokeSync(null, request, timeoutMillis); assert response != null; switch (response.getCode()) { case ResponseCode.SUCCESS: { byte[] body = response.getBody(); if (body != null) { TopicList topicList = TopicList.decode(response.getBody(), TopicList.class); if (topicList.getTopicList() != null && !topicList.getTopicList().isEmpty() && !UtilAll.isBlank(topicList.getBrokerAddr())) { TopicList tmp = getSystemTopicListFromBroker(topicList.getBrokerAddr(), timeoutMillis); if (tmp.getTopicList() != null && !tmp.getTopicList().isEmpty()) { topicList.getTopicList().addAll(tmp.getTopicList()); } } return topicList; } } default: break; } throw new MQClientException(response.getCode(), response.getRemark()); }