简体   繁体   中英

JMS Counting the number of pending messages in a topic domain

First of all sorry for the new topic created. I did it because unfortunately the others was not very clear to me.

Problem.
I'd like to know if it's possible to count the number of messages pending in a topic sub/pub. I am using tomcat and activemq in the test enviroment but I am going to use Tibco in the real enviroment. Is there a simple and generic way for do that.

Obs
I have already implemented a consumer cliente with pure JMS and it can receive all message from its topic very well.

For your development environment, if you use ActiveMQ and want to see the number of pending messages in a topic/queue, you can use JMX support of ActiveMQ to monitor JMS topic/queue. A good introduction on using JMX for ActiveMQ is given in this article . Note that once you have an intance of QueueViewMBean , you can get the number of messages yet to be sent by calling getQueueSize method. For Tibco broker, I don't know if they provide similar functionality as ActiveMQ. I think it depends on different JMS broker implementations.

Are you familiar with the TIBCO GEMS (graphical EMS admin) tool? It's downloadable for free on the tibcommunity website

GEMS can display you pending messages for a durable subscriber ona a TIBCO EMS topic

Solved

First of all, thank you everbody who helped me. I have finished this task a couple of weeks ago but unfortunately I wasn't able to share with you what I did to solve it. The concept of JMS wasn't very clear into my mind and from my point of view it was pivotal for the problem solution.

To begin with, informations related to pending messages is cointained into provider.
Each provider implements its all classes to deal with this kind of information.

Tibco jars
Tibco provides a jar called tibjmsadmin there you can find all informations such as statistics related to a topic or queue.

Solution
As solution the tibjmsadmin was implemented into my project, therefore the access to topic's information is being made through its classes.

tibjmsadmin: https://docs.tibco.com/pub/enterprise_message_service/6.3.0-february-2012/doc/html/tib_ems_api_reference/api/javadoc/com/tibco/tibjms/admin/package-summary.html

oracle specification: http://www.oracle.com/technetwork/java/docs-136352.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM