I found the following link to read messages from JMS Queue and its working.
https://blogs.oracle.com/soaproactive/entry/jms_step_3_using_the
Now I want to read JMS queue statistics programmatically like number of messages, number of pending messages and message in/out time etc. Is it possible in weblogic or weblogic provide any API for this purpose?
Please help.
consumer-count The number of consumers consuming messages from this queue.
In the Administration Console, expand Services > Messaging > JMS Modules. In the JMS Modules table, click the JMS module that contains the configured queue that you want to access. In the selected JMS module's Summary of Resources table, click the queue that you want to monitor. Click the Monitoring > Statistics tab.
The JMS IQ Manager is set to fully concurrent FIFO processing. However, each Collaboration on each integration server retrieves messages as they come in, and is able to commit them unrestricted to the queue.
The parameter destination is a Queue or Topic object that the application has created previously. The application then uses the receive() method of the MessageConsumer object to receive a message from the destination, as shown in the following example: Message inMessage = consumer. receive(1000);
Statistics are part of a message broker implementation and thus vendor-specific. One popular implementations is ActiveMQ. It can be run in WebLogic Server or WebLogic Express.
Note: There are obviously many other JMS implementations around, and you should carefully evaluate for yourself which implementation suits your needs. Nevertheless, I shall use it as an example to point out the relevant features for your case:
Beginning with version 5.3, ActiveMQ ships with a statistics plugin
that can be used to retrieve statistics from the broker or its destinations.
You should be able to actively poll statistics from within your code by sending messages to specific destinations within the broker, see linked documentation for details.
Another feature of ActiveMQ is Advisory messages. Enable it in your broker's configuration and it
allows you to watch the system using regular JMS messages.
In this way, you can passively react to certain events in the messaging system , e.g. when a queue exceeds some threshold.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With