YongGoose commented on code in PR #7492:
URL: https://github.com/apache/incubator-seata/pull/7492#discussion_r2234489430


##########
common/src/main/java/org/apache/seata/common/util/HttpClientUtil.java:
##########
@@ -173,6 +294,46 @@ public static CloseableHttpResponse doGet(
         return null;
     }
 
+    public static CompletableFuture<SimpleHttpResponse> doGetHttp2(String url, 
Map<String, String> headers, int timeout)
+            throws IOException {
+        try (CloseableHttpAsyncClient http2Client = HttpAsyncClients.custom()
+                .setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2)
+                
.setDefaultRequestConfig(org.apache.hc.client5.http.config.RequestConfig.custom()
+                        .setConnectTimeout(timeout, TimeUnit.MILLISECONDS)
+                        .setResponseTimeout(timeout, TimeUnit.MILLISECONDS)
+                        .setConnectionRequestTimeout(timeout, 
TimeUnit.MILLISECONDS)
+                        .build())
+                .build()) {
+            http2Client.start();
+
+            SimpleHttpRequest request = new SimpleHttpRequest("GET", url);
+            if (headers != null) {
+                headers.forEach(request::setHeader);
+            }
+            CompletableFuture<SimpleHttpResponse> future = new 
CompletableFuture<>();

Review Comment:
   Done in 
https://github.com/apache/incubator-seata/pull/7492/commits/a4e36d58d8f12687196345266aa63ae8a334e26b
 !



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to