Author |
Message
|
knock2mq |
Posted: Wed Mar 10, 2010 8:42 am Post subject: Queue in Use:clearing messages |
|
|
Novice
Joined: 09 Jan 2010 Posts: 17
|
Hi,
I have found a queue in use by a OPPROC in zOS. But need to clear messages from the queue. What will be the effect of using "CLEAR BY USING MQGET API CALLS" in MQEXPLORER.
Is that a best practice or we should inform put application to release queue when not in use and then clear messages. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 10, 2010 8:50 am Post subject: Re: Queue in Use:clearing messages |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
knock2mq wrote: |
What will be the effect of using "CLEAR BY USING MQGET API CALLS" in MQEXPLORER. |
Unless whatever has the queue open has an exclusive lock it will clear the messages.
knock2mq wrote: |
Is that a best practice or we should inform put application to release queue when not in use and then clear messages. |
It's a valid practice and you should inform the applicaiton to release the queue when not in use. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
knock2mq |
Posted: Wed Mar 10, 2010 9:02 am Post subject: Re: Queue in Use:clearing messages |
|
|
Novice
Joined: 09 Jan 2010 Posts: 17
|
knock2mq wrote: |
knock2mq wrote: |
Is that a best practice or we should inform put application to release queue when not in use and then clear messages. |
It's a valid practice and you should inform the applicaiton to release the queue when not in use. |
Thank you Vitor. But I am confused by your last line. Is it a best practice to directly go ahead and clear messages using MQGET in MQ EXPLORER or instead we should inform the application to release the queue when not in use.
Also what is the difference between CLEAR and clear using MQGET API in MQ EXPLORER ?
Can you please provide me document link where I can educate myself better ? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 10, 2010 9:12 am Post subject: Re: Queue in Use:clearing messages |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
knock2mq wrote: |
Thank you Vitor. But I am confused by your last line. Is it a best practice to directly go ahead and clear messages using MQGET in MQ EXPLORER or instead we should inform the application to release the queue when not in use. |
It's valid to clear queues in the way you describe.
It's bad practice for an application to hold a queue when not in use and you should request the application change it's behaviour.
knock2mq wrote: |
Also what is the difference between CLEAR and clear using MQGET API in MQ EXPLORER ? |
One uses the CLEAR command, the other reads the queue until it's empty.
knock2mq wrote: |
Can you please provide me document link where I can educate myself better ? |
Link's at the top of this page. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
knock2mq |
Posted: Wed Mar 10, 2010 9:19 am Post subject: Re: Queue in Use:clearing messages |
|
|
Novice
Joined: 09 Jan 2010 Posts: 17
|
Vitor wrote: |
knock2mq wrote: |
Thank you Vitor. But I am confused by your last line. Is it a best practice to directly go ahead and clear messages using MQGET in MQ EXPLORER or instead we should inform the application to release the queue when not in use. |
It's valid to clear queues in the way you describe.
It's bad practice for an application to hold a queue when not in use and you should request the application change it's behaviour. |
But I guess if the queue is in use by a put application and we directly clear old messages(current depth) in queue using MQGET, it may clear all messages including new ones put by put application which will result in loss of new desired messages. So, don't you think we should first inform the application to release queue then we should use either MQGET or CLEAR command ? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 10, 2010 9:24 am Post subject: Re: Queue in Use:clearing messages |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
knock2mq wrote: |
So, don't you think we should first inform the application to release queue then we should use either MQGET or CLEAR command ? |
I said it was valid to use that method to clear a queue down; I never said when it should be done!
I also assumed that the handle on the queue was spurious since (as you correctly point out) it's a very silly idea to clear a queue with either method while it's in use. Much like changing the tyre on a car while it's moving down the road; the amount of problems caused increase with how fast things are going, but there's no way it will end well!
If you want to clear out only old messages then both methods in MQExplorer are unsuitable. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
knock2mq |
Posted: Wed Mar 10, 2010 9:30 am Post subject: |
|
|
Novice
Joined: 09 Jan 2010 Posts: 17
|
Thank you very much Vitor for your valuable feedback. |
|
Back to top |
|
 |
bruce2359 |
Posted: Wed Mar 10, 2010 9:50 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Clearing a queue is one of those bad business practices.
If applications puts bad messages to a queue, applications should get these messages out of the queue - conforming to whatever business process is appropriate.
I don't grant clear auth to programmers in TEST, knowing that they will want to use it in PROD. In this case, they have asked you to clear the messages.
Here's a question for you? Do you think your auditors will have a problem with clearing (not processing) messages from queues? _________________ 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 |
|
 |
fjb_saper |
Posted: Wed Mar 10, 2010 10:46 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Clearly if you have a problem with "old" messages that should be cleared there is something wrong in the environment or design.
If the "old" messages should be cleared, ask the putting application to make them expire. You will then have no such problem.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|