I'm using ActiveMQ 5.3.2. My app is a distributed system that creates lots of connections to the AMQ broker. Right now, my app occasionally runs into issues such as the producer stops producing messages, the AMQ broker non-responding, etc. I'm interested to find out the total number of connections to my AMQ broker, but I cou开发者_Python百科ldn't find this number anywhere in my JConsole where I can find out other numbers like total number of topics, queues, etc.
Does anyone know how to find out the total number of connections to a AMQ broker?
If you want to find the total number of connections to your broker, you can look that up in JMX under:
org.apache.activemq.Connection.[Protocol]
where Protocol is something like "Openwire" connections. There will be an MBean per connection. Beyond that, there's not a good way to get a total count.
Can you explain more about why your broker is not responding? By the sounds of it, you've simply hit Producer Flow Control.
You also should consider upgrading to ActiveMQ 5.5. The impact on your code and build should be minimal and consist only of updated client libs for 5.5's activemq-core (and activemq-pool) dependency).
You can use JMX library to retrive Mbean Type = Broker and fetch the attribute TotalConnectionsCount on your Broker.
精彩评论