activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: Current Connection Count for ActiveMQ broker
Date Wed, 22 Jan 2014 15:08:43 GMT
Sure, that's one way if you're using an embedded broker and have
direct access to the broker's API.

You could also use JMX to query the stats.

You could also subscribe to the connection advisory topic and count
how many messages about started connections you get back.

On Wed, Jan 22, 2014 at 7:40 AM, khandelwalanuj
<khandelwal.anuj90@gmail.com> wrote:
> Hi,
>
> I want to know current connection count for ActiveMQ broker. I am using
> below APIs for this:
> -------------------------------------------------------------------
> BrokerService brokerService = getBrokerService();
> connectors = brokerService.getTransportConnectors();
> for (int i = 0 ; i < 3; i++)
> {
>     TransportConnector t = connectors .get(i);
>     LOG.info("t.getConnections().size());
> }
> -------------------------------------------------------------------
>
> Is this the right way or I should use some other approach ?
>
>
> Thanks,
> Anuj
>
>
>
>
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/Current-Connection-Count-for-ActiveMQ-broker-tp4676635.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Mime
View raw message