VERTX WebClient池
我使用VERTX WebClient消耗了3种不同的(主机)API,下面是我使用WebClient的方式,
WebClientOptions options = new WebClientOptions();
options.setSsl(true);
options.setMaxPoolSize(50);
client = WebClient.create(vertx, options);
client.postAbs(url)
.timeout(10000)
.sendJsonObject(payLoad)
如何汇总该连接?我检查了WebClient代码(WebClientBase> httprequestimpl> httpContext&gttpclientRequest
),但我无法找到在哪里以及如何实现连接池。
基于API主机或所有API的一个客户端创建多个网络电脑是否很好?请分享您的意见。
I am using vertx WebClient to consume 3 different(host) APIs, below is how I use Webclient,
WebClientOptions options = new WebClientOptions();
options.setSsl(true);
options.setMaxPoolSize(50);
client = WebClient.create(vertx, options);
client.postAbs(url)
.timeout(10000)
.sendJsonObject(payLoad)
How would the connection be pooled? I checked the WebClient code(WebClientBase>HttpRequestImpl>HttpContext>HttpClientRequest
) but I was not able to find where and how connection pooling is implemented.
Is it good to create multiple WebClient based on the API host or one client for all the APIs? Please share your inputs.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最大池大小为每个目的地。
可以在不同目的地使用单个
WebClient
使用。如果您需要为每个目的地调整选项,则每个目标都会创建一个客户端。
池实现在于基础
httpclient
。The max pool size is per destination.
It is fine to use a single
WebClient
for different destinations.You would create a client per destination if you needed to tune the options differently for each of them.
The pool implementation lies in the underlying
HttpClient
.