在PoolingClientConnectionManager中检查可用的连接 [英] Check available connections in PoolingClientConnectionManager

查看:71
本文介绍了在PoolingClientConnectionManager中检查可用的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法(以及如何)知道连接池的状态?就像,正在使用多少个连接,多少个可用,...

Is there a way (and how) to know the status of a connection pool? Like, how many connections are being used, how many are available, ...

我们当前面临的问题是应用程序无法从池中获得连接(ConnectionPoolTimeoutException:等待池中的连接超时),以便找出导致每次请求新连接时我们都要记录一些池统计信息的原因.

We are currently facing issues where the application cannot get a connection from the pool (ConnectionPoolTimeoutException: Timeout waiting for connection from pool) so to track down the cause we would like to log some pool stats each time a new connection is requested.

我一直在浏览Apache HTTPClient API,但是没有找到获取此信息的方法.

I have been browsing the Apache HTTPClient API but did not find a way to get this information.

我们使用PoolingClientConnectionManager.

We use PoolingClientConnectionManager.

推荐答案

您可以使用

You can use methods of the ConnPoolControl interface to control parameters of the internal pool

这篇关于在PoolingClientConnectionManager中检查可用的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆