Posted By:
Andreas_Mueller
Posted On:
Thursday, July 4, 2002 03:14 AM
Yes, you can query the management tree with the CLI Admin API. Look here:
http://www.swiftmq.com/products/router/admin/adminapi/index.htmlThe CLI Admin API utilizes CLI commands. So all what you have to do is to figure out with CLI what commands you need. To query the number of messages in queue "testqueue" with CLI it is:
> Router 'router1' is available for administration.
> sr router1
router1> cc /sys$queuemanager/usage/testqueue
router1/sys$queuemanager/usage/testqueue> lc
Entity: Active Queue
Description: Active Queue
Properties for this Entity:
Name Current Value
--------------------------------------------------------------
flowcontrol-delay (R/O) 0
messagecount (R/O) 0
Entity contains no Sub-Entities.
router1/sys$queuemanager/usage/testqueue>
A non-durable subscriber is backed by a temp queue. So you need an additional step to figure out to which temp queue the subscriber is bound to. To list active subscribers, perform:
router1/sys$topicmanager/usage> cc /sys$topicmanager/usage/subscriber
router1/sys$topicmanager/usage/subscriber> lc
Entity List: Active Topic Subscriber
Description: Active Topic Subscriber
Entities in this List:
----------------------
swiftmq.jndi-18
t0-12
t0-13
t0-14
t0-17
t0-2
t0-5
t1-1
t1-10
t1-11
t1-16
t1-4
t1-9
t2-0
t2-15
t2-3
t2-6
t2-7
t2-8
router1/sys$topicmanager/usage/subscriber>
Pick your subscriber, e.g. "swiftmq.jndi-18" and check the "boundto" attribute:
router1/sys$topicmanager/usage/subscriber> lc swiftmq.jndi-18
Entity: An Active Topic Subscriber
Description: An Active Topic Subscriber
Properties for this Entity:
Name Current Value
--------------------------------------------------------------
boundto (R/O) tmp$0@router1
clientid (R/O) Internal Swiftlet Usage
nolocal (R/O) false
selector (R/O)
topic (R/O) swiftmq.jndi
Entity contains no Sub-Entities.
router1/sys$topicmanager/usage/subscriber>
It is bound to "tmp$0@router1". Now check the number of messages in that queue:
router1/sys$topicmanager/usage/subscriber> lc /sys$queuemanager/usage/tmp$0
Entity: Active Queue
Description: Active Queue
Properties for this Entity:
Name Current Value
--------------------------------------------------------------
flowcontrol-delay (R/O) 0
messagecount (R/O) 0
Entity contains no Sub-Entities.
router1/sys$topicmanager/usage/subscriber>