|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Question on Triggering |
« View previous topic :: View next topic » |
Author |
Message
|
ssuman |
Posted: Mon Sep 30, 2002 9:15 am Post subject: Question on Triggering |
|
|
Newbie
Joined: 30 Sep 2002 Posts: 1
|
Hi All:
I have a question about triggering. I have setup my queue with trigger type Every. My triggered application is designed to process one message at a time. Now for some reason if the triggered application failed even before connecting to the queue manager, the message is never processed and it’s in the queue. When the next message arrives triggering will occur and the first message is processed. The actual message, which caused the triggering, is not processed. So is there a way that the queue manager put a trigger message whenever there are pending messages in the queue with trigger type every and no messages in the initiation queue? To make sure all the messages in the queue are processed, I want to know if there are any other options other than modifying my application to process the queue until there are no messages.
Thanks in advance.
suman. |
|
Back to top |
|
 |
bower5932 |
Posted: Mon Sep 30, 2002 10:34 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I don't know of any way to 'force' a trigger message. I'd suggest that you make some changes to your program to process all messages that are in the queue. There are also some exception situations that are discussed in the Application Programming Guide. You might want to look over them. You might find yourself getting into trouble with one of them as well. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Sep 30, 2002 4:52 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Change your app to Trigger OnFirst. Then set the trigger Interval value on the queue manager to a really small value, like maybe 1 second.
With this configuration, in your scenario, the 2nd message would cause a retrigger, assuming it landed on the queue more than TriggerInterval seconds after the previous message (thats why I said set it to a really small value). Your app would trigger, get the first message, and then close the queue. As it closes the queue, the QM sees that an app is closing a Trigger OnFirst queue while there are more than zero messages on it, and thus will retrigger. This behaviour will keep happening till your queue is emptied. This behaviour is only available on Trigger type of First.
Some words of warning:
1.What makes you think the 2nd message will succesfully trigger the app when the first one didn't?
2. Your app needs to be coded to gracefully handle finding no messages on the queue, since someone putting a message to the triggered queue under syncpoint and then backing it out will still cause a trigger message to go to the queue.
3. If you have any kind of volume at all here, you are MUCH better off upping the TriggerInterval to a reasonable value like 5 or more minutes, leaving it Triggered OnFirst, and change your app to read the queue until empty with a reasonable WaitInterval on the GET. Otherwise, with the setup I described above, you are going to get barraged with a TON of trigger messages. Yes they will all be valid, but why keep starting your app over and over?
Trigger Every is rarely the right choice. It also introduces the problem that you found. If your app is not coded to drain the queue each time it starts, you will eventually (this is a given) hit the situation you came across: a rolling back log of messages on the queue.
Why do you think you need Every? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|