Author |
Message
|
chirayu |
Posted: Wed May 04, 2011 3:41 am Post subject: Manually retrieve and repost persistent messages |
|
|
Apprentice
Joined: 04 May 2011 Posts: 30
|
Hi All,
Let me first explain the scenario:
Say I have the following setup:
1. Queue Manager QM1 ---> queue Q1 (defpsist(yes))
2. Queue Manager QM2 ---> queue Q2 (defpsist(yes))
QM1 is active and QM2 is passive. Whatever messages come on QM1 should follow a seqeunce.
Now for some reason QM1 goes down, and I cannot bring it up for say an hour or so (for any reason); so the solution with me is to start QM2 and point the traffic to it.
But since the messages follow a sequence, I want to make sure that whatever messages where piled up in QM1 before it went down should go through first before I can start QM2.
Is there any way to check and retrieve the persistent messages from a queue manager when it is down?
Hope I am clear in my query!
Regards,
Chirayu |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 04, 2011 3:47 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You are clear in your query.
There is no way to get any kind of message from a queue manager that is stopped.
You need to resolve this issue in a different manner, perhaps by using a multi-instance queue manager or by using a queue manager under HA control.
And you should also not use messages that require to be in a sequence. It is a bad idea. |
|
Back to top |
|
 |
Vitor |
Posted: Wed May 04, 2011 4:18 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I agree with everything my most worthy associate has said.
I chip in with the now often-repeated point that setting defpsist(yes) doesn't make the messages persistent. Message persistence is under the control of the putting application (which, before anyone says anything, may well use the queue setting).
Anyone who attempts to restart the debate on if applications should use the queue setting or set it directly will be moderated. We've got enough threads on that already.......
I mention it again only because the OP seems certain the messages will be persistent (and mentioned it in the title). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
chirayu |
Posted: Fri May 06, 2011 2:17 am Post subject: |
|
|
Apprentice
Joined: 04 May 2011 Posts: 30
|
hi jeff,
Many thanks for the reply, sorry for acknowledging it late. I am exploring the multi-instance queue manager solution for my setup as you have advised.
In case you or anyone reading this post come across any other solution do reply please.
Just to mention, the message sequencing is a business requirement hence have to live with it !!
Anyways thanks again for replying!
Regards,
Chirayu |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri May 06, 2011 7:49 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
chirayu wrote: |
Just to mention, the message sequencing is a business requirement hence have to live with it !!
|
Retrieving messages in the exact sequence they were put to a queue is discussed in the WMQ Application Programming Guide and WMQ Application Programming Reference. This subject has been discussed in other posts here, as well.
As offered by others in this post, messages in queues of a dead qmgr are stranded until the qmgr is restarted.
Your OP did not mention what might have caused the hypothetical qmgr to fail. MI offers a possible resolution to this, but presumes that the "shared" filesystem is NOT damaged, and was not the cause of the qmgr failure.
chirayu wrote: |
Is there any way to check and retrieve the persistent messages from a queue manager when it is down? |
On midrange WMQ, no. On WMQ for z/OS, yes. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 06, 2011 8:20 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
On WMQ for z/OS, yes. |
Provided that the queue has been added to a QSG ahead of time.
AFAIK it's as impossible to extract messages from a page set as it is from a midrange file system. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri May 06, 2011 9:03 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Vitor wrote: |
bruce2359 wrote: |
On WMQ for z/OS, yes. |
Provided that the queue has been added to a QSG ahead of time.
AFAIK it's as impossible to extract messages from a page set as it is from a midrange file system. |
Nothing to do with QSG membership. Refer to the WMQ for z/OS System Administration manual for CSQUTIL utility program. There's a section entitled: "Copying queues into a data set while the queue manager is not running (SCOPY)".
CSQUTIL can open a pageset and retrieve messages while the qmgr is down. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 06, 2011 9:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
There's a section entitled: "Copying queues into a data set while the queue manager is not running (SCOPY)". |
So there is. Forgotten every word about that.
Worth underlining that it's a copy, not a move so duplicate messages have to considered as part of the recovery. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri May 06, 2011 9:32 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Vitor wrote: |
bruce2359 wrote: |
There's a section entitled: "Copying queues into a data set while the queue manager is not running (SCOPY)". |
So there is. Forgotten every word about that.
Worth underlining that it's a copy, not a move so duplicate messages have to considered as part of the recovery. |
The very same CSQUTIL utility includes an EMPTY command (delete messages) that can be run when next the qmgr is restarted. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
Vitor |
Posted: Fri May 06, 2011 9:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
bruce2359 wrote: |
The very same CSQUTIL utility includes an EMPTY command (delete messages) that can be run when next the qmgr is restarted. |
Exactly the sort of thing you should consider using.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
mvic |
Posted: Fri May 06, 2011 12:19 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
chirayu wrote: |
Just to mention, the message sequencing is a business requirement hence have to live with it !! |
Is the sequence never-ending.. Is there never an opportunity for a new batch to be begun, or for an in-flight batch to be backed out and re-attempted?
I don't think you can really implement a strict sequencing requirement with a switchover or HA solution. Everything must be up, and when it's not, you can't switch to a parallel track.
Maybe your requirement is not quite as restrictive.. not sure. |
|
Back to top |
|
 |
bruce2359 |
Posted: Fri May 06, 2011 12:29 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
chirayu wrote: |
Just to mention, the message sequencing is a business requirement hence have to live with it !!
|
How exactly does the producing application sequence the messages?
Does the producing app just assume that all of the messages put will arrive in order at the receiving queue?
How exactly does the consuming application guarantee that one or more of messages in the sequence is/are not missing? _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
chirayu |
Posted: Wed May 11, 2011 1:49 am Post subject: |
|
|
Apprentice
Joined: 04 May 2011 Posts: 30
|
Hi guys,
Many thanks for so many replies and apologies for not checking the topic for a couple of days; was caught up in some other work.
Anyways, to answer a couple of queries regarding how the sequencing rule is (sorry I cannot reveal the exact scenario but will explain it with a similar hypothetical scneario):
Consider System A is tracking the order delivery of some products in some company say XYZ enterprises.
Now XYZ enterprises will send the status of a particular order to system A via MQ.
The order stages and their sequence cud be:
1. Order Placed
2. Order Created
3. Order Packed
4. Order Dispatched
Now after completion of each stage XYZ will send the notifications to system A regarding the current stage the order is in.
As mentioned in my first post the setup is QM1 is active and QM2 is pasisve.
So all messages are flowing thru QM1.
Now say for a particular order the messages sent by XYZ to system A via QM1 are:
1. Order Placed
2. Order Created
XYZ sent msg 3 as well which is:
3. Order Packed
But unfortunately before the message was read by system A, QM1 went down and the msg 3 (Order Packed) is now stuck in QM1
Now to avoid outage I will start QM2; QM2 is started and XYZ will send msg 4 i.e. Order Dispatched.
But now system A is confused that before "Order Packed" msg it received "Order Dispatched".
Hence to avoid this I want that before QM2 starts processing any other msgs from XYZ I want that the msg 3 which is stuck in QM1 to be manually removed from QM1 (which is down) and posted on QM2 first before I start the traffic from XYZ to QM2.
This will help in maintaining the sequence of messages.
Hope this answers the sequencing rule queries
Regards,
Chirayu |
|
Back to top |
|
 |
chirayu |
Posted: Wed May 11, 2011 1:52 am Post subject: |
|
|
Apprentice
Joined: 04 May 2011 Posts: 30
|
Sorry forgot to mention....
I am using MQ version 7 and the operating system is LINUX. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed May 11, 2011 1:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Again, you can't do this the way you want to, not really.
You need to do something to ensure that QM1 "stays running", by using multi-instance or HA. |
|
Back to top |
|
 |
|