How is it that the number of pending messages for the server foo (output of the “ I “ (Info) command ) is less than the number of messages pending for that topic?
book
Article ID: KB0093162
calendar_today
Updated On:
Products
Versions
TIBCO Enterprise Message Service
-
Not Applicable
-
Description
Resolution: The number of pending messages on the server is the actual number of messages pending system wide. On the other hand the pending messages on topics are the sum of number of messages pending multiplied by number of subscriber per topic.
Example:
There are 3 subscribers and 1 publisher to a topic bar. Say the publisher published 2 messages on topic bar but has yet to receive any ACKs. The "show topics" will show a total 6 (2messages * 3 subscribers) pending on topic bar and the "i" command will show only 2 messages pending.
The reason that the pendingMessageCount divided by the subscriber count does not always equal an integer is that some messages may have been confirmed by some subscribers so the direct division might not yield an integer.
Example:
A publisher publishes 2 messages on a topic and there are 5 subscribers to that subject. If no messages are confirmed then there will be 10 messages pending on the topic and 2 messages pending on the server. Now, say one consumer confirmed one message. Then, there will be 9 pending messages on the topic, 2 messages on the sever, and 5 subscribers to the topic. In this case, the division does not result in an integer (9/5 = 1.8).
What is happening is that the server only stores the 2 messages, but marks 9 pending for delivery. Also, even if the topic is failsafe, non-persistent messages will not be stored to disk. In such cases, the show topics will display a higher value than the show db values. The show topics stats are shown irrespective of the message location - in memory or on disk where as the DB values are system-wide stats. As mentioned above, you have to consider cases where the messages are not yet ACK-ed.
Issue/Introduction
How is it that the number of pending messages for the server foo (output of the “ I “ (Info) command ) is less than the number of messages pending for that topic?