【发布时间】:2018-11-09 21:53:08
【问题描述】:
在 jersey 客户端应用 ConnectionKeepAliveStrategy for ApacheConnector 时需要帮助。
对于独立的 Apache 客户端,我们可以这样做 -
ConnectionKeepAliveStrategy myStrategy = new ConnectionKeepAliveStrategy() {
public long getKeepAliveDuration(HttpResponse response, HttpContext context) {
//your strategy here..
}
};
CloseableHttpClient client = HttpClients.custom()
.setKeepAliveStrategy(myStrategy)
.build();
但我在使用 Jersey 客户端时找不到任何应用策略的方法。 尝试将上述功能类注册到 WebClient,但没有帮助。
有什么线索吗?
【问题讨论】:
标签: apache jersey jersey-client connector