I have implemented JMS and code to expose brokers for monitoring the status of queues, load, and so forth by creating proxies from various broker view interfaces (DestinationViewMBean, BrokerViewMBean, ConnectionViewMBean connectionViewMBean, JmsConnectorViewMBean), packaging the data in a POJO named BrokerStatistics, and remoting it to the client on demand. But all those connections...not at all a good design and I want to simplify my strategy.
Very stripped down, I basically do a
which essentially does for local or remote brokers:
Depending on whether the local broker on the same server is up or has failed over to a remote broker, I generate a JMXServiceURL in the general form of
MBeanServerConnection mbsc = MBeanConnection.getLocalMBeanServerConnection(port, hostName);
TypeSafeMBeanProxy.newMBeanProxy(mbsc, objectName, intfClass);
which creates the mbeans to populate BrokerStatistics. I had read about the HttpInvokerServiceExporter and will give that a try.