0

I need to get the numver of messages passes through the sonic queue per minute via a java code. I need this so i can create an alert when this messages per minute is higher than normal count. Can some on please assist me with this. Thanks

Lloyd95
  • 73
  • 7

1 Answers1

0

this information should be available via JMX (enqueued/dequeued count).

try to connect to the broker with VisualVM to find the ObjectName and Attributes.

to access sonicmq by JMX :

Hashtable env = new Hashtable( );
env.put(“ConnectionURLs", "tcp://localhost:2506");
env.put("DefaultUser", "Administrator");
env.put("DefaultPassword", "Administrator");
JMSConnectorAddress address = new JMSConnectorAddress(env);
JMSConnectorClient connector = new JMSConnectorClient( );
connector.connect(address);
ObjectName brokerName = new ObjectName(“Domain1.Container1:ID=Broker1”);
MBeanInfo mi = connector.getMBeanInfo(brokerName );
... usual JMX attributes access
Hassen Bennour
  • 3,885
  • 2
  • 12
  • 20