healchow commented on code in PR #7629:
URL: https://github.com/apache/inlong/pull/7629#discussion_r1139823959
##########
inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/service/AuditMsgConsumerServer.java:
##########
@@ -96,4 +127,66 @@ private List<InsertData> getInsertServiceList() {
}
return insertServiceList;
}
+
+ private List<MQClusterInfo> getConfigManager() {
+ Properties properties = new Properties();
+ try (InputStream inputStream =
getClass().getClassLoader().getResourceAsStream(DEFAULT_CONFIG_PROPERTIES)) {
+ properties.load(inputStream);
+ String managerHosts = properties.getProperty("manager.hosts");
+ String clusterName = properties.getProperty("proxy.cluster.name");
+ String clusterTag = properties.getProperty("proxy.cluster.tag");
+ String[] hostList = StringUtils.split(managerHosts, ",");
+ for (String host : hostList) {
+ List<MQClusterInfo> mqConfig = getMQConfig(host, clusterName,
clusterTag);
+ if (ObjectUtils.isNotEmpty(mqConfig)) {
+ return mqConfig;
+ }
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ return null;
+ }
+
+ private List<MQClusterInfo> getMQConfig(String host, String clusterName,
String clusterTag) {
+ HttpPost httpPost = null;
+ Gson gson = new Gson();
+ try {
+ String url = "http://" + host +
"/inlong/manager/openapi/dataproxy/getConfig";
Review Comment:
Extract to a global contant.
--
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]