healchow commented on code in PR #7629:
URL: https://github.com/apache/inlong/pull/7629#discussion_r1139822488


##########
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";
+            LOG.info("start to request {} to get config info", url);
+            httpPost = new HttpPost(url);
+            httpPost.addHeader(HttpHeaders.CONNECTION, "close");
+
+            // request body
+            DataProxyConfigRequest request = new DataProxyConfigRequest();
+            request.setClusterName(clusterName);
+            request.setClusterTag(clusterTag);
+            StringEntity stringEntity = new StringEntity(gson.toJson(request));
+            stringEntity.setContentType("application/json");
+            httpPost.setEntity(stringEntity);
+
+            // request with post
+            LOG.info("start to request {} to get config info with params {}", 
url, request);
+            CloseableHttpResponse response = httpClient.execute(httpPost);
+            String returnStr = EntityUtils.toString(response.getEntity());
+            // get groupId <-> topic and m value.
+

Review Comment:
   Unnecessary blank line here.



-- 
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]

Reply via email to