ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » a question about triggering

Post new topic  Reply to topic
 a question about triggering « View previous topic :: View next topic » 
Author Message
atoms
PostPosted: Wed Mar 08, 2006 5:59 am    Post subject: a question about triggering Reply with quote

Apprentice

Joined: 10 Jun 2005
Posts: 27

I have this program (on windows 2k) which is set up to be triggered (trigger type=first) when messages arrive on a queue on my qmgr. The triggered program then gets the messages from the queue and writes them to disk.

The program is written so that it turns off triggering, then it checks for messages and if a message is found it gets the message, writes it to a file, performs some more processing and finally, it checks if any more messages are found, turns on triggering again and exits.

Well, this seems to work fine in about 99.8% of the times messages arrives. However, the other day this program exited, for some unknown reason, in the middle of an operation on one message. This lead to that the program did not turn on triggering again and the subsequent messages that arrived on the queue were stuck there.

Is there some way I could prevent this from happening, i.e. I would like the program to roll back the operation of getting the message if it does not successfully complete its processing and then it should be triggered again to retry the message processing (ideally even if the server crashes in the middle of a message processing cycle). On the other hand, I would not want this to put the program in an endless loop in case it really can't process the message.

Could anyone please give me an advice on this subject or point me to some "best practices"? Would it be easier instead to set up a "monitor" of some kind that monitors the queue and alerts when messages pile up above a certain threshold? How could this be done?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Mar 08, 2006 6:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

In order to "roll back" a get, you need to use syncpoint. That is, a single-phase transaction. This can be enabled in the GetMessageOptions that you use to fetch the message, and then with the commit and rollback verbs.

It is not standard, or best, practices to have your program intervene in the triggering mechanisms the way you have. It leads to exactly the situations you have found, where your program can get disabled and not know it.

If you have a message that can not be processed, the normal means of dealing with this is to use the Backout Threshold and Backout Requeue Name properties of the queue to determine how many times the message has been backed out, and where to put it when it has been backed out too many times. The logic to process these properties must be written into your application.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
atoms
PostPosted: Thu Mar 09, 2006 12:24 am    Post subject: Reply with quote

Apprentice

Joined: 10 Jun 2005
Posts: 27

Ok, thanks for your help Jeff! I'll get started on studying these subjects.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » a question about triggering
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.