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
<[email protected]> 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

Reply via email to