Is Queue monitoring through java program (like current traffic on queue) possible ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nishant_kumar
Posted On:   Wednesday, July 3, 2002 11:29 PM


Hi
I need to know if swiftmq provide some Apis through which we can know how many messages are on the queue at a particular time and other information like messages stored for a particular subscriber etc.Also can we configure those paramters through java program ?
I read about Cli Api.But i think it just help to create/delete/modify various swiftlet properties.
Regards
Nishant


Re: Is Queue monitoring through java program (like current traffic on queue) possible ?

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.html


The 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>
About | Sitemap | Contact