Author |
Message
|
ramires |
Posted: Fri Aug 02, 2002 2:13 am Post subject: Force msgs to be persistent |
|
|
Knight
Joined: 24 Jun 2001 Posts: 523 Location: Portugal - Lisboa
|
Hi MQ Net,
Is it possible to force all messages put to a q to be persitent ? Even if the put aplication uses MQPER_NOT_PERSISTENT ?
I'm receiving messages from a remote site, they are created as not persistent, but in my local q I need them persistent.
Using and exit in the receiving channel ? Are there samples ?
Thanks
Joao |
|
Back to top |
|
 |
mrlinux |
Posted: Fri Aug 02, 2002 3:12 am Post subject: |
|
|
 Grand Master
Joined: 14 Feb 2002 Posts: 1261 Location: Detroit,MI USA
|
there is no way to force messages to be persistent. _________________ Jeff
IBM Certified Developer MQSeries
IBM Certified Specialist MQSeries
IBM Certified Solutions Expert MQSeries |
|
Back to top |
|
 |
PeterPotkay |
Posted: Fri Aug 02, 2002 4:30 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Kinda hokey, but you could write a little app that picks up a message, changes the persistence, and then reputs it right away. You still got a window where you can lose messages, but its a lot smaller.
If you really have a valid need for persistent messages, then the sending side is clearly in the wrong for not complying. Its a very minor programming change to meet your requirements.
Tell them "Do it, and if not, don't complain if your messages get lost!" _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
ramires |
Posted: Fri Aug 02, 2002 7:51 am Post subject: |
|
|
Knight
Joined: 24 Jun 2001 Posts: 523 Location: Portugal - Lisboa
|
Thanks !
Sometimes its dificult to talk to the people doing the MQPUT, because they are several queue managers distance.
Geting and putting the message to queue seams a good idea.
Joao |
|
Back to top |
|
 |
bower5932 |
Posted: Fri Aug 02, 2002 10:13 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
You might want to try and convince them to use MQPER_PERSISTENCE_AS_Q_DEF. You can then define the queue with or without persistence and it won't have any effect on their code. |
|
Back to top |
|
 |
ssanchez |
Posted: Fri Aug 02, 2002 12:03 pm Post subject: |
|
|
 Newbie
Joined: 19 Jun 2002 Posts: 7 Location: Chile
|
IT'S POSSIBLE!!!!
You can modify any field of the Message Descriptor structure using a Channel Exit. You can do this on the Send Channel Exit or on the Receive Channel Exit.
In fact, I did a Receive Channel Exit to change: User Id, Queue Name and Persistence... It Works!!!
Samuel.  _________________ Samuel. |
|
Back to top |
|
 |
ramires |
Posted: Mon Aug 05, 2002 1:29 am Post subject: |
|
|
Knight
Joined: 24 Jun 2001 Posts: 523 Location: Portugal - Lisboa
|
Thanks to all,
Samuel, did you code that exit based on a sample ? Is it available somewhere ?
Joao |
|
Back to top |
|
 |
bob_buxton |
Posted: Mon Aug 05, 2002 1:56 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
Even if you use a channel exit to make them persistent as they arrive on your queue manager they will still have been non persistent until they arrived and thus liable to loss due to an failure at the intermediate nodes.
Depending on the platform you could use an API crossing exit to change the persistence on the originating queue manager.
Bob _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
oz1ccg |
Posted: Mon Aug 05, 2002 3:36 am Post subject: |
|
|
 Yatiri
Joined: 10 Feb 2002 Posts: 628 Location: Denmark
|
By the way the new message exit (v. 5.3) should be able the trick.
I have not studied the manuals to deep yet.
Just my $0.02  _________________ Regards, Jørgen
Home of BlockIP2, the last free MQ Security exit ver. 3.00
Cert. on WMQ, WBIMB, SWIFT. |
|
Back to top |
|
 |
Tibor |
Posted: Mon Aug 05, 2002 3:48 am Post subject: |
|
|
 Grand Master
Joined: 20 May 2001 Posts: 1033 Location: Hungary
|
bob_buxton wrote: |
Depending on the platform you could use an API crossing exit to change the persistence on the originating queue manager.
|
If you are working on v5.2 CSD4, API exit is a sophisticated solution. There is a little problem: I found description about it in only manuals for v5.3, however MQ v5.2 binaries contents API exit points... (NT, Linux, AIX, Solaris, HP-UX) |
|
Back to top |
|
 |
ramires |
Posted: Mon Aug 05, 2002 7:28 am Post subject: |
|
|
Knight
Joined: 24 Jun 2001 Posts: 523 Location: Portugal - Lisboa
|
bob_buxton wrote: |
Even if you use a channel exit to make them persistent as they arrive on your queue manager they will still have been non persistent until they arrived and thus liable to loss due to an failure at the intermediate nodes.
|
Bob,
the platform is 5.2 on AIX. Can you give a short explanation about "API crossing exit". Do I need to code it on both sides, this is, msg originator and msg receiver ? In my case the originator is a 390, 2 NT boxes in the middle and my AIX in the end.
Thanks !
Joao |
|
Back to top |
|
 |
ssanchez |
Posted: Mon Aug 05, 2002 4:12 pm Post subject: |
|
|
 Newbie
Joined: 19 Jun 2002 Posts: 7 Location: Chile
|
Hi!!!...
I'm preparing an example of a Channel Exit (in ANSI C) to run on Windows NT, AS/400 and UNIX. It's a Dummy Channel Exit only for study intentions.
I think tomorrow I'll put the code in the repository software of this site.
I'll let you know when it's done.
Samuel.  _________________ Samuel. |
|
Back to top |
|
 |
bduncan |
Posted: Mon Aug 05, 2002 9:00 pm Post subject: |
|
|
Padawan
Joined: 11 Apr 2001 Posts: 1554 Location: Silicon Valley
|
Remember, you can't add the code directly to the software repository. Just email it to me, and then I'll make sure it's added within a day or two... _________________ Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator |
|
Back to top |
|
 |
bob_buxton |
Posted: Tue Aug 06, 2002 1:46 am Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
Quote: |
Bob,
the platform is 5.2 on AIX. Can you give a short explanation about "API crossing exit". Do I need to code it on both sides, this is, msg originator and msg receiver ? In my case the originator is a 390, 2 NT boxes in the middle and my AIX in the end.
Thanks !
Joao) |
I am not familiar with the API crossing on AIX (I'm a mainframe dinosaur ) but for your purposes you would need to use it the 390 side.
Unfortunately on the mainframe it is only available when using MQ from CICS.
Essentially the exit is called before and after every MQ API call, (MQOPEN,
MQPUT, MQGET etc) and is passed the same information that is coded on the API call. So to make a message persistent you would in the pre-MQPUT call just set MQMD.Persistent to MQPER_Persistent.
See the Application Programming Guide for further details.
Note The exit is called for all MQ calls from a CICS region so you have to take care not to impact performance too much - you might not want to make every message written by CICS persistent! Since you are passed the same info as the API at Put time the exit sees the queue handle and not the queue name so it might not be obvious if the message is destined for your applications queue.
Bob _________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
ramires |
Posted: Tue Aug 06, 2002 5:10 am Post subject: |
|
|
Knight
Joined: 24 Jun 2001 Posts: 523 Location: Portugal - Lisboa
|
Thanks to all.
It's very nice to have a place like this to discuss ideas !
Joao |
|
Back to top |
|
 |
|