【发布时间】:2019-03-27 19:34:41
【问题描述】:
我正在尝试使用 useSystemProperties() 创建一个 http 客户端,因为我需要将 ssl 属性默认为 WAS 的属性[比如在运行时获取 WAS 密码]。而且我还必须为 httpclient 设置一些最大连接数和连接管理器。这是一个非常高流量的休息电话。
我尝试了 3 种方法,
-- This did not set the WAS ssl properties and thus the connection got failed.
httpclient = HttpClients.custom().useSystemProperties()
.setConnectionManager("some value")
.setMaxConnPerRoute("some value")
.setMaxConnTotal("some value")
.setUserAgent("Custom Browser")
.disableCookieManagement().build();
-- This did not set the WAS ssl properties and thus the connection failed.
httpclient1 = HttpClientBuilder.create().useSystemProperties()
.setConnectionManager(connManager)
.setMaxConnPerRoute(maxConnPerRoute)
.setMaxConnTotal(maxConnTotal)
.setUserAgent("Custom Browser")
.disableCookieManagement().build();
-- This one defaulted to WAS ssl configurations and connection was fine but other params are missing here.
httpclient2 = HttpClientBuilder.create().useSystemProperties().build();
我真的可以同时实现这两个选项吗?
【问题讨论】:
标签: java apache http httpclient