The intent of trigtype=first is to initiate a program to process the queue any time it contains messages. MQ has several provisions (including triggerinterval and condition 12) to make sure that happens. Trigger condition 12 generates a trigger event when the last application processing the queue closes without having first emptied the queue. Consequently, when the (only) program to have the queue open abends/closes while there are messages remaining, MQ retriggers in its relentless effort to process everything in the queue.
Keeping that in mind, triggered applications generally need to include some trigger-related housekeeping. If the program detects a critical condition like you suggest, it might be prudent to set the afflicted queue to NOTRIGGER and alert operations or the MQ Admin. For example, if the triggered queue cannot be opened or an error is detected before it is opened, you probably need some of intervention to get the messages flowing again. Problems can also crop up after the queue is opened, in which case you have the additional complication of re-triggering as per condition 12 . You may want to design some elements into your application to detect these conditions and take appropriate action. One simplistic approach is to use TRIGTYPE=DEPTH(1), which disables triggering as soon as the trigger fires. Your application can then resume triggering when the queue is empty and just prior to its graceful close. Beyond that, some general guidelines are: 1. If you have a bad message, move it to a set-aside queue and move on to the next message 2. If you have a transient condition, allow some number or retries and/or a wait period 3. If you have a permanent condition, quiesce triggering and issue an alert 4. Always check to RC's and react proactively 5. If possible, trap exceptions, errors, and abends attempting to maintain program control when things to south 6. Consider restart logic that is capable of detecting previous and/or repetitive abends > -----Original Message----- > From: moshe moran [SMTP:[EMAIL PROTECTED]] > Sent: Thursday, June 13, 2002 12:36 AM > To: [EMAIL PROTECTED] > Subject: Re: triggerinterval > > Peter, thanks for your answer. But, there are cases (some fatal > errors,etc') that I really doesn't want to read all the > queue until it is empty because all the other messages will get the same > errors. I read the chapter about 'conditions for trigger event' and I > still do not understand why I got another trigger message that cause the > trigger monitor to start the server program > again. > Thanks in advance for any tip or suggestion. Moish > > ----- Original Message ----- > From: Potkay, Peter M (PLC, IT) > <mailto:[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > Sent: Wednesday, June 12, 2002 3:07 PM > Subject: Re: triggerinterval > > You are misunderstanding the purpose of the triggerinterval. It is > there for cases where a trigger on first queue somehow gets more than 1 > message on it without being triggered. Because a trigger on first queue > only generates a trigger message when the queue depth goes from 0 to 1 > (and the queue is closed, plus about 10 other conditions ), no trigger > message will get generated if the queue is closed but the depth goes from > 1 to 2, or 100 to 101, etc. Unless the triggerinterval comes into play. > > Triggerinterval means that if this amount of time has passed, and > now another message lands on the queue after this interval, regardless of > whether the depth goes from 0 to 1 or n to n+1, go ahead and generate a > trigger message, as long as all the other trigger conditions are met. The > default is 999,999,999 (over 3 years), so that's pretty useless. I set > mine to 300,000, which means every 5 minutes if I somehow got a trigger on > first queue with more than 0 messages on it, the very next message will > trigger the app and all should be good. Without this interval set, I would > manually have to start the trigger in this case. Remember, its the trigger > interval passing PLUS the arrival of another message on the queue that > will generate the trigger message. > > > The behavior you are seeing is another feature of trigger first > queues. That is, if a queue that is triggered on first is closed by the > app, but that queue has more than 0 messages on the queue at the time of > the close, the QM will generate another trigger message . This was done to > cover the situation where you get until no more messages on the queue, and > then between your get failing with 2033 and your close call, 1 or more > messages land on the queue. TriggerInterval has nothing to do with this > behavior. > > (It sounds like your triggered app only gets one message and ends. > Probably not a good idea. It should get triggered and read the queue until > empty, then end) > > > See the app programming guide, chapter 14, conditions for > triggering. It goes into great detail on all of the above. > > > > Peter Potkay > IBM MQSeries Certified Specialist, Developer > [EMAIL PROTECTED] > X 77906 > > -----Original Message----- > From: moshe moran [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, June 12, 2002 2:57 AM > To: [EMAIL PROTECTED] > Subject: triggerinterval > > > > I work in os390 2.8 mq 2.1. > I used trigger type=first in the local queue and trigger > interval=999,999,999 in the qmgr. > But it seems to me that this trigger interval has no effect > because if i have 2 messages in the input queue and while i process > the first one i have abend or i finish the transaction other > way at this second started the new transaction trying to process the > second message from the input queue even the triggerinterval is long > enough. > As i understand in this situation the trigger didn't change > and the next transaction shouldn't be started because the trigger > interval . > please your advise. thanks > > > > This communication, including attachments, is for the exclusive use > of > addressee and may contain proprietary, confidential or privileged > information. If you are not the intended recipient, any use, > copying, > disclosure, dissemination or distribution is strictly prohibited. If > > you are not the intended recipient, please notify the sender > immediately by return email and delete this communication and > destroy all copies. > > Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive
