Author |
Message
|
Djeyli |
Posted: Thu Jul 04, 2002 4:25 am Post subject: Message Timeout and re-route ? |
|
|
 Apprentice
Joined: 03 Apr 2002 Posts: 28 Location: New Zealand
|
Hi there
I have an application which reads messages off a queue. The problem is that it is not always reliable !!
I would like to know whether there is a way to make a message 'timeout' after being 15 seconds on the queue, and for MQ to re-route it to another queue.
Regards
James |
|
Back to top |
|
 |
bduncan |
Posted: Thu Jul 04, 2002 8:39 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Could you go into a little more detail about what you mean by "unreliable" ? MQSeries guarantees deliver, so you shouldn't have to worry about the messages not being on the queue. And if it is your application, it can probably be debugged and/or rewritten such that it isn't "unrealiable".
That being said, the timeout functionality in MQSeries simply means that the message will no longer be available for MQGET from the queue after its expiry is exceeded. MQSeries will not route the message somewhere else after this period. If this is a message you can't afford to lose, then you wouldn't want to use expiry under any circumstances anyway. If it's a message you can afford to lose, then there is no need to reroute it to another queue, you can just let it expire.
You can use however a pretty much bulletproof program written in C called getput (it's available in the software repository) that will pick up messages from a queue and put them to another queue. Right now it does this as fast as it can, but you can change the code such that it will wait a certain amount of time before moving the message. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
Djeyli |
Posted: Thu Jul 04, 2002 11:04 pm Post subject: Unreliable application |
|
|
 Apprentice
Joined: 03 Apr 2002 Posts: 28 Location: New Zealand
|
The application we use is unfortunately been worked on by a number of consultants at all times. The result of this is that the MQ addon keeps going down. There is nothing we can do about it at this stage. The MQSeries side is fine - messages arrive as expected.
The catch is that it is imperative that these messages get through within a few seconds.
I will certainly try that getput proggie - it seems as tho it might just be what we are looking for.
Thanks for the reply ! |
|
Back to top |
|
 |
nimconsult |
Posted: Fri Jul 05, 2002 5:57 am Post subject: |
|
|
 Master
Joined: 22 May 2002 Posts: 268 Location: NIMCONSULT - Belgium
|
You could simply run multiple instances of the "unreliable" application on the same queue. No need for re-routing. If one instance fails, the other instances will consume the message.
Additional enhancement: write a simple program that monitors the number of running instances of the application; if one instance fails the monitor automatically restarts one. You can find the number of running instances by reading the number of "open input" on the MQ Series queue. _________________ Nicolas Maréchal
Senior Architect - Partner
NIMCONSULT Software Architecture Services (Belgium)
http://www.nimconsult.be |
|
Back to top |
|
 |
bduncan |
Posted: Fri Jul 05, 2002 7:52 am Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Or use triggering. You can set the trigger to occur when the first message arrives on the queue. When the program fails, messages will continue to pile up on the queue. If you set the trigger interval to a small enough number, the queue manager will retrigger the application when it detects that messages are no longer being consumed. _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
|