Author |
Message
|
RobP |
Posted: Thu Nov 08, 2007 9:50 am Post subject: Enforcing persistance on incoming messages |
|
|
Newbie
Joined: 08 Nov 2007 Posts: 6
|
I'm trying to find out if there is a way to ensure messages that arrive on my queues are set to persistent, irrespective of the settings the sending application set for the message.
The messages i receive come from another company and although we have asked that the messages be sent as persistent, i don't wish to be at the mercy of the sending policy of an outside entity. It struck me as something MQ might have a setting for to enforce the use of the queue's default persistence setting. I mean, we used it because it guarantees the message will be delivered, shouldn't i be able to guarantee it will remain long enough to be processed (even if the server crashes/restarts)?
i have done some reading around and the only option that has presented itself is either a channel or API exit to alter the messages as they come in. Everything i have read has told me that exits are to be avoided where possible. Is there another way?
I did read the below thread, but that was 2002 and its a brave new world with version 6.0.2.1
http://mqseries.net/phpBB2/viewtopic.php?p=16792&sid=07888a662f1b9c0c81206d6e4b074c14
Our MQ server is a windows box running MQ version 6.0.2.1
Thanks in advance |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Nov 08, 2007 9:55 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Sure, there's another way.
Put an intermediate process in between the receiver queue and your reciever applications, that reads the messages on the queue and then puts them to another queue (for the receiver application) with the right persistence.
Or you can reduce your risk of losing non-persistent messages by setting NPMCLASS on the receiver queue to "HIGH". Then NP messages will survive a normal qmgr restart - and may survive some qmgr crashes (or may not). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
RobP |
Posted: Thu Nov 08, 2007 10:32 am Post subject: |
|
|
Newbie
Joined: 08 Nov 2007 Posts: 6
|
We have considered an intermediate process and were looking into what this would entail, namely creating copies of all our existing queues for the process to move messages between. This in it's self is not a massively desirable task.
So there isn't an "out of the box" solution?
Thank you for the information in your second point, definitely worth ensuring that setting is correct on our server. |
|
Back to top |
|
 |
rtsujimoto |
Posted: Thu Nov 08, 2007 10:50 am Post subject: |
|
|
Centurion
Joined: 16 Jun 2004 Posts: 119 Location: Lake Success, NY
|
What happens if the sending queue manager goes down while transmitting the NP messages? What about that small window when the messages are put to the intermediate queue, and the receiving queue manager goes south? The only real solution is having the customer change their code. |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Nov 08, 2007 11:14 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
RobP wrote: |
So there isn't an "out of the box" solution? |
Nope.
Just "out of the box" opportunities - i.e. an exit or the intermediate queue. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Mehrdad |
Posted: Thu Nov 08, 2007 11:56 am Post subject: |
|
|
Master
Joined: 27 Feb 2004 Posts: 219 Location: Europe
|
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Nov 09, 2007 7:11 am Post subject: |
|
|
Guest
|
Taking your post literally "...to ensure messages that arrive on my queues are set to persistent"
This implies that non-persistent messages be trapped in a Message Channel Receive exit as they are extracted from the network AND before they are placed in any queue where they run the risk of being lost at qmgr restart.
In the Receive exit, your exit program has access to the complete message (MQMD and application data). This is the place to (re)set the persistence value.
Search Mr. Google for mq sample receive exit code. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Nov 09, 2007 9:23 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
bruce2359 wrote: |
In the Receive exit, your exit program has access to the complete message (MQMD and application data). This is the place to (re)set the persistence value.
Search Mr. Google for mq sample receive exit code. |
Hi,
If you are really going down this path then I would strongly suggest that you use a channel message exit rather than channel receive exit.
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri Nov 09, 2007 9:40 am Post subject: |
|
|
Guest
|
Quote: |
use a channel message exit rather than channel receive exit. |
Yep. |
|
Back to top |
|
 |
|