You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/03/03 12:53:07 UTC

[GitHub] [incubator-inlong] aloyszhang commented on a change in pull request #2806: [INLONG-2805][DataProxy] Add stream config log report

aloyszhang commented on a change in pull request #2806:
URL: https://github.com/apache/incubator-inlong/pull/2806#discussion_r818625981



##########
File path: inlong-common/src/main/java/org/apache/inlong/common/reporpter/AbstractReporter.java
##########
@@ -96,25 +94,27 @@ public AbstractReporter(CloseableHttpClient httpClient, String serverUrl, int co
         this.httpClient = httpClient;
     }
 
-    public R syncReportData(T data, String serverUrl) throws Exception {
+    public Response syncReportData(T data, String serverUrl) throws Exception {
+        if (StringUtils.isEmpty(serverUrl)) {
+            LOGGER.warn("Report config log server url is empty, so config log can not be "
+                    + "reported!");
+            return null;
+        }
         HttpPost httpPost = new HttpPost(serverUrl);
         try {
             StringEntity stringEntity = new StringEntity(gson.toJson(data));
             stringEntity.setContentType(AGENT_HTTP_APPLICATION_JSON);
             httpPost.setEntity(stringEntity);
             String returnStr = executeHttpPost(httpPost);
-            ResponseType<R> re = parse(returnStr);
-            if (re != null) {
-                return re.getResponse();
-            }
+            LOGGER.debug("Reporter returnStr = {}", returnStr);

Review comment:
       `LOGGER.debug` should be covered by `LOGGER.isDebugEnabled`




-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org