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
Code:
MBeanProxyInstance.getProxyInstance(BrokerViewMBean.class, getObjectName("Broker"));
which essentially does for local or remote brokers:
Code:
MBeanServerConnection mbsc = MBeanConnection.getLocalMBeanServerConnection(port, hostName);
TypeSafeMBeanProxy.newMBeanProxy(mbsc, objectName, intfClass);
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
Code:
new JMXServiceURL("service:jmx:rmi:///jndi/rmi://"+hostName+":"+port+"/jmxrmi");
which creates the mbeans to populate BrokerStatistics. I had read about the HttpInvokerServiceExporter and will give that a try.
thanks,
Helena