【发布时间】:2015-09-07 17:05:59
【问题描述】:
如果setConnectionManagerShared 设置为true,由于某种原因HttpAsyncClient 不会发出请求。我找到了这个bug,但不知道我错过了什么。
这是我创建新客户的方法
def apply(proxy: Option[HttpHost], cookieStore: Option[CookieStore]) = {
val builder = HttpAsyncClients.custom.
setConnectionManager(connManager).
setConnectionManagerShared(true).
setDefaultCredentialsProvider(credentialsProvider).
setDefaultRequestConfig(defaultRequestConfig).
setSSLStrategy(sslStrategy)
proxy.map(builder.setProxy)
builder.setDefaultCookieStore(cookieStore.getOrElse(new BasicCookieStore)) // Use custom cookie store if necessary.
// Create an HttpClient with the given custom dependencies and configuration.
val client: HttpAsyncClient = new HttpAsyncClient(builder.build)
client
}
全班位于here。
我应该改变什么?
【问题讨论】:
标签: apache-httpclient-4.x apache-commons-httpclient asynchttpclient apache-httpasyncclient