Author |
Message
|
ashly |
Posted: Tue Jan 09, 2007 4:18 am Post subject: triggertype problem !! |
|
|
Newbie
Joined: 10 Oct 2006 Posts: 8
|
Hi all,
we have websphere 5.3/linux for our app.We have come across the following scenario today.
*)The triggertype is set to 'FIRST' for queue 'Q'
*)The TRIGGER on the Q is turned off.
*)we have put 10 messages into the Q.
*)The TRIGGER is turned on.
*) ideally as I understand only one init message should be generated - for the first message in the Q.
*)But to our amazement we find the trigger program is fired 10 times!!! [indicating that there are 10 init messages]
Does anyone have any clue on what is happening? |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 09, 2007 4:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Make sure your triggered app services the queue until empty and does not disconnect from the queue after each message....  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ashly |
Posted: Tue Jan 09, 2007 4:31 am Post subject: |
|
|
Newbie
Joined: 10 Oct 2006 Posts: 8
|
yes we are doing the same.
*)the Triggered app is a Java Pgm
*) it runs, until all messages are consumed and then disonnect from MQ.
The problem is the program is getting triggered again [due to init messages?]
while my understanding is that only one init message should be generated and in that scenario the program will not be triggered again. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 09, 2007 4:35 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
ashly wrote: |
yes we are doing the same.
*)the Triggered app is a Java Pgm
*) it runs, until all messages are consumed and then disonnect from MQ.
The problem is the program is getting triggered again [due to init messages?]
while my understanding is that only one init message should be generated and in that scenario the program will not be triggered again. |
Looks like you misunderstood. If the program disconnects from the QUEUE between messages, the qmgr considers the queue as no longer being serviced. This may lead to the generation of a trigger message.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 09, 2007 4:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What FJ is saying is that your code needs to be
1) MQCONN
2) MQOPEN
3) Loop
4) MQGET
5) While not 2033
6) MQCLOSE
7) MQDISC
If you are doing anything else, like
1) MQCONN
2) Loop
3) MQOPEN
4) MQGET
5) MQCLOSE
6) While not 2033
7) MQDISC
Then you'll get a new trigger message at every MQCLOSE, potentially.
I'd suggest you start the trigger monitor in some manner such that you can watch the stdout of it, to see what it thinks is going on.
Or go back and re-read the trigger conditions page and go through each one (all 14 or so) and match it with your setup until you find where you have done something differently.
The odds of this being the result of a bug in MQ are very small. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
exerk |
Posted: Tue Jan 09, 2007 5:26 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
It may also be worth checking that the TRIGINT attribute has not been set to a ridiculously small interval, unlikely but it removes one more thing from the equation. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
ashly |
Posted: Tue Jan 09, 2007 7:42 pm Post subject: |
|
|
Newbie
Joined: 10 Oct 2006 Posts: 8
|
Thanks Guys!
we used JMS api to connect and receive the message.
*)in the 'get()' we had a new QueueReceiver obj created every time and we used to close the receiver obj every time.
*) Removed the above portion.
==> the code is noe working fine.
Thanks. |
|
Back to top |
|
 |
|