moremind commented on code in PR #3438:
URL: https://github.com/apache/incubator-shenyu/pull/3438#discussion_r884935231


##########
shenyu-spring-boot-starter/shenyu-spring-boot-starter-plugin/shenyu-spring-boot-starter-plugin-httpclient/src/main/java/org/apache/shenyu/springboot/starter/plugin/httpclient/HttpClientPluginConfiguration.java:
##########
@@ -93,26 +93,32 @@ public HttpClient httpClient(final HttpClientProperties 
properties,
         HttpClientProperties.Pool pool = properties.getPool();
         ConnectionProvider connectionProvider = buildConnectionProvider(pool);
         HttpClient httpClient = HttpClient.create(connectionProvider)
-                .tcpConfiguration(tcpClient -> {
-                    if (Objects.nonNull(properties.getConnectTimeout())) {
-                        tcpClient = 
tcpClient.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
properties.getConnectTimeout());
-                    }
-                    HttpClientProperties.Proxy proxy = properties.getProxy();
-                    if (StringUtils.isNotEmpty(proxy.getHost())) {
-                        tcpClient = setTcpClientProxy(tcpClient, proxy);
-                    }
-                    // To write and read timeouts are serving as generic 
socket idle state handlers.
-                    tcpClient = tcpClient.doOnConnected(connection -> {
-                        connection.addHandlerLast(new 
IdleStateHandler(properties.getReaderIdleTime(), 
properties.getWriterIdleTime(), properties.getAllIdleTime(), 
TimeUnit.MILLISECONDS));
-                        connection.addHandlerLast(new 
WriteTimeoutHandler(properties.getWriteTimeout(), TimeUnit.MILLISECONDS));
-                        connection.addHandlerLast(new 
ReadTimeoutHandler(properties.getReadTimeout(), TimeUnit.MILLISECONDS));
-                    });
-                    final LoopResources loopResources = 
provider.getIfAvailable();
-                    if (Objects.nonNull(loopResources)) {
-                        tcpClient = tcpClient.runOn(loopResources);
-                    }
-                    return tcpClient;
-                });
+                .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 
properties.getConnectTimeout());
+        HttpClientProperties.Proxy proxy = properties.getProxy();
+        if (StringUtils.isNotEmpty(proxy.getHost())) {
+            httpClient.proxy(proxySpec -> {
+                ProxyProvider.Builder builder = proxySpec

Review Comment:
   ok, I will wrap this method.



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