healchow commented on code in PR #8357:
URL: https://github.com/apache/inlong/pull/8357#discussion_r1246170435
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/queue/tubemq/TubeMQOperator.java:
##########
@@ -248,4 +265,60 @@ private void createConsumerGroupOpt(String masterUrl,
String topicName, String c
}
}
+ /**
+ * Query topic message for the given tubemq cluster.
+ */
+ public List<BriefMQMessage> queryLastMessage(TubeClusterInfo tubeCluster,
String topicName,
+ Integer messageCount, InlongStreamInfo streamInfo) {
+ LOGGER.info("begin to query message for topic {}", topicName);
+ String masterUrl = tubeCluster.getMasterWebUrl();
+ TubeBrokerInfo brokerView = this.getBrokerInfo(masterUrl);
+ String brokerUrl = brokerView.getOneWorkBrokerIp();
+
+ List<BriefMQMessage> messageList = new ArrayList<>();
+ try {
+ String url =
+ "http://" + brokerUrl + QUERY_LAST_MESSAGE_PATH +
TOPIC_NAME + topicName + MSG_COUNT + messageCount;
Review Comment:
It is recommended to provide a template, and then use the `String.format()`
method to observe the URL format more directly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]