Author |
Message
|
sudda_1 |
Posted: Wed Sep 17, 2008 8:56 am Post subject: Unable to trigger message into initiation queue |
|
|
Newbie
Joined: 17 Sep 2008 Posts: 8
|
I'm trying to achieve the following:
Queue Manager should trigger a message to MY_INITIATION_QUEUE when number of messages in MY_LOCAL_QUEUE reaches 10. A Message Drive Bean(MDB) will be a listener to MY_INITIATION_QUEUE. When MDB is invoked it will send alert e-mail to admin that queue depth has reached 10.
MQ environment: Windows 2003 server. I'm using MQ Explorer GUI tool for configuration.
Configuration steps taken:
1) Local queue MY_LOCAL_QUEUE exists
2) Created initiation queue MY_INITIATION_QUEUE(local queue type)
2) Added Triggering properties for MY_LOCAL_QUEUE
Trigger Control:ON, Trigger type: DEPTH, Trigger Depth:10, Initiation Queue:MY_INITIATION_QUEUE, Trig Msg Priority: 0, Trig Data, Process Name
3) Stopped all listeners for MY_LOCAL_QUEUE
4) Started listener MDB for MY_INITIATION_QUEUE
Problem
I put 10 messages in MY_LOCAL_QUEUE but no luck. I'm expecting to see a trigger message in MY_INITIATION_QUEUE and the MDB to pickup and process this message.
Can someone tell me if the steps listed above are correct. Has anyone else done something similar.
Also in the MQ Explorer GUI I see that Trigger Control gets set to OFF. Although I set it to ON it does not get set.
I really need some help on this one. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Sep 17, 2008 9:11 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
It would be helpful if you would DISPLAY your queue and process objects (using runmqsc); then cut/paste the output of the display command directly into your post.
From the display, we could see the current status of the objects. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Last edited by bruce2359 on Wed Sep 17, 2008 9:13 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 17, 2008 9:12 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
you need as well to use MSOB to reset triggering. Qdepth >1 triggering automatically sets the Q trigger to off when triggering. Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ranganathan |
Posted: Wed Sep 17, 2008 9:46 am Post subject: Re: Unable to trigger message into initiation queue |
|
|
 Centurion
Joined: 03 Jul 2008 Posts: 104
|
sudda_1 wrote: |
[b]
3) Stopped all listeners for MY_LOCAL_QUEUE
4) Started listener MDB for MY_INITIATION_QUEUE
|
I hope you've started the Trigger monitor process (runmqtrm) that will monitor the Initiation queue and starts the process defined...
Syntax:
runmqtrm [-m QMgrName] [-q InitQ] |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 17, 2008 10:12 am Post subject: Re: Unable to trigger message into initiation queue |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
ranganathan wrote: |
I hope you've started the Trigger monitor process (runmqtrm) that will monitor the Initiation queue and starts the process defined...
Syntax:
runmqtrm [-m QMgrName] [-q InitQ] |
This is not strictly necessary, in particular because sudda_1 is implementing their own trigger monitor.
All that is required in order to generate a trigger message on the initiation queue is that a valid number of the 14 requirements for doing so are met. And one of those reqiurements is "someone, anyone, has the initiation queue open for input", which an MDB meets.
sudda_1 is otherwise solving this problem entirely wrong. Monitoring tools should leverage the accounting/stats/monitoring functions in the queue manager, and not try to misuse triggering to reinvent a square wheel. |
|
Back to top |
|
 |
sudda_1 |
Posted: Wed Sep 17, 2008 10:19 am Post subject: |
|
|
Newbie
Joined: 17 Sep 2008 Posts: 8
|
No one had commented on the use of using Java MDB (Message Driven Bean) as a consumer of my initiion queue. So i assume my approach is correct. |
|
Back to top |
|
 |
sudda_1 |
Posted: Wed Sep 17, 2008 10:40 am Post subject: |
|
|
Newbie
Joined: 17 Sep 2008 Posts: 8
|
fjb_saper wrote: |
you need as well to use MSOB to reset triggering. Qdepth >1 triggering automatically sets the Q trigger to off when triggering. Enjoy  |
You are right. When I put the 10th message Q trigger control got set to OFF. Which means triggering happend ??
I also noticed that the Open Input Count value for MY_INITIATION_QUEUE became 2(Open input was 1 previously because of the listening MDB).
So here is my question. Where did the trigger message go? It's not in the MY_INITIATION_QUEUE nor did my listener MDB consume it. So what happend ?
Code: |
AMQ8450: Display queue status details.
QUEUE(MY_LOCAL_QUEUE ) TYPE(QUEUE)
CURDEPTH(10) IPPROCS(0)
LGETDATE( ) LGETTIME( )
LPUTDATE( ) LPUTTIME( )
MONQ(OFF) MSGAGE( )
OPPROCS(0) QTIME( , )
UNCOM(NO)
AMQ8450: Display queue status details.
QUEUE(MY_INITIATION_QUEUE) TYPE(QUEUE)
CURDEPTH(0) IPPROCS(2)
LGETDATE( ) LGETTIME( )
LPUTDATE( ) LPUTTIME( )
MONQ(OFF) MSGAGE( )
OPPROCS(0) QTIME( , )
UNCOM(NO)
|
|
|
Back to top |
|
 |
sudda_1 |
Posted: Wed Sep 17, 2008 11:48 am Post subject: |
|
|
Newbie
Joined: 17 Sep 2008 Posts: 8
|
OK, I found out the problem.
The MDB was getting called, it was just that I was not handling Byte message structue.
Now once I read the trigger message, send the e-mail I need to reset the trigger control to ON. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Sep 17, 2008 12:07 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
What are you going to do when the q depth goes over ten but the trigger conditions are otherwise not met, meaning q depth > 10 but no trigger message generated? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
sudda_1 |
Posted: Wed Sep 17, 2008 12:44 pm Post subject: |
|
|
Newbie
Joined: 17 Sep 2008 Posts: 8
|
I don't see the scenario you mentioned happening.
q depth reaches 10
Trigger puts message in initiation queue (Queue Mgr sets trigger control to OFF)
MDB gets invoked
MDB sends out e-mail to Admin
Admin fixes problem(Starts DB, resolves network issue etc)
Admin starts application listener
Application consumes messages
When q<10 Admin sets Trigger control on queue to ON again
Back to step 1
Ours is a very small environment with just 2 QMs at the moment. I will think of a way to automate reset of trigger control. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Sep 17, 2008 1:15 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
What happens when the queue is open by the app to consume messages and they arrive so fast the q depth goes over 10? No trigger message.
What happens when the app opens the queue but hangs, and doesn't consume any messages, and the q depth goes over 10? No trigger message.
If misusing triggering was the right way to monitor q depth everyone would be doing it instead of "wasting" money on monitoring tools. I do applaud you for coming up with a crafty way. Its just not foolproof. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Sep 17, 2008 1:27 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9470 Location: US: west coast, almost. Otherwise, enroute.
|
If all you want to do is monitor queue depth, take a look at MQINQ. With this call, you can inquire on all the values of all the attributes of all MQ objects. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
gbaddeley |
Posted: Wed Sep 17, 2008 6:03 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
Queue depth can also be monitored using MQ Queue Depth Events. Set the appropriate queue attributes and queue manager attributes. This will cause MQ to generate event messages on the SYSTEM.ADMIN.PERFM.EVENT when the depth crosses the low and high depth thresholds and also when the queue is full. _________________ Glenn |
|
Back to top |
|
 |
ranganathan |
Posted: Thu Sep 18, 2008 1:09 am Post subject: Re: Unable to trigger message into initiation queue |
|
|
 Centurion
Joined: 03 Jul 2008 Posts: 104
|
mqjeff wrote: |
This is not strictly necessary, in particular because sudda_1 is implementing their own trigger monitor.
All that is required in order to generate a trigger message on the initiation queue is that a valid number of the 14 requirements for doing so are met. And one of those reqiurements is "someone, anyone, has the initiation queue open for input", which an MDB meets.
sudda_1 is otherwise solving this problem entirely wrong. Monitoring tools should leverage the accounting/stats/monitoring functions in the queue manager, and not try to misuse triggering to reinvent a square wheel. |
Thanks 'mqjeff'. I did not know this information before.. |
|
Back to top |
|
 |
sudda_1 |
Posted: Thu Sep 18, 2008 7:31 am Post subject: |
|
|
Newbie
Joined: 17 Sep 2008 Posts: 8
|
PeterPotkay wrote: |
What happens when the queue is open by the app to consume messages and they arrive so fast the q depth goes over 10? No trigger message.
What happens when the app opens the queue but hangs, and doesn't consume any messages, and the q depth goes over 10? No trigger message.
|
Peter you are right. It's not a foolproof method.
If my need is only to monitor queue depth, is the event monitoring mechanism a foolproof method. gbaddeley has summarized it as follows:
gbaddeley wrote: |
Queue depth can also be monitored using MQ Queue Depth Events. Set the appropriate queue attributes and queue manager attributes. This will cause MQ to generate event messages on the SYSTEM.ADMIN.PERFM.EVENT when the depth crosses the low and high depth thresholds and also when the queue is full. |
I can write a MDB that's a listener to SYSTEM.ADMIN.PERFM.EVENT queue. The MDB can process the event message and send e-mail to Admin. Does anyone see any issues with this approach? |
|
Back to top |
|
 |
|