I believe this is the easiest way to get information from MBean via Admin server
– Look for the target MBean type “com.bea:ServerRuntime=….,Type=JMSServerRuntime
– getMBeansByType will return MBeans

However, The method Helper is deprecated and you actually need a working connection to managed servers otherwise it will fail.


MBeanHome mbh = Helper.getAdminMBeanHome("weblogic", "weblogic123", "t3://127.0.0.1:7001");
Set jmsruntimes = mbh.getMBeansByType("JMSServerRuntime");
System.out.println("Size:"+jmsruntimes.size());
for (JMSServerRuntimeMBean jMSServerRuntimeMBean : jmsruntimes) {
System.out.println(jMSServerRuntimeMBean.getName());
JMSDestinationRuntimeMBean[] destRT = jMSServerRuntimeMBean.getDestinations();

for (JMSDestinationRuntimeMBean a : destRT) {
System.out.println("=="+a.getName()+","+a.getMessagesReceivedCount());

}
}