147.5.3. 配置 Http 客户端
HipChat 组件允许您自己的 HttpClient 配置。这可以通过在 registry 中定义 CloseableHttpClient 引用(例如 Spring Context),然后在 Endpoint 定义中设置 参数,例如: hipchat:http://api.hipchat.com?httpClient=#myHttpClient。
CloseableHttpClient httpclient = HttpClients.custom()
.setConnectionManager(connManager)
.setDefaultCookieStore(cookieStore)
.setDefaultCredentialsProvider(credentialsProvider)
.setProxy(new HttpHost("myproxy", 8080))
.setDefaultRequestConfig(defaultRequestConfig)
.build();要查看有关 Http 客户端配置的更多信息,请查看 官方文档。