ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Queue in Use:clearing messages

Post new topic  Reply to topic
 Queue in Use:clearing messages « View previous topic :: View next topic » 
Author Message
knock2mq
PostPosted: Wed Mar 10, 2010 8:42 am    Post subject: Queue in Use:clearing messages Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Mar 10, 2010 8:50 am    Post subject: Re: Queue in Use:clearing messages Reply with quote

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
View user's profile Send private message
knock2mq
PostPosted: Wed Mar 10, 2010 9:02 am    Post subject: Re: Queue in Use:clearing messages Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Mar 10, 2010 9:12 am    Post subject: Re: Queue in Use:clearing messages Reply with quote

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
View user's profile Send private message
knock2mq
PostPosted: Wed Mar 10, 2010 9:19 am    Post subject: Re: Queue in Use:clearing messages Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Wed Mar 10, 2010 9:24 am    Post subject: Re: Queue in Use:clearing messages Reply with quote

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
View user's profile Send private message
knock2mq
PostPosted: Wed Mar 10, 2010 9:30 am    Post subject: Reply with quote

Novice

Joined: 09 Jan 2010
Posts: 17

Thank you very much Vitor for your valuable feedback.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Wed Mar 10, 2010 9:50 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Mar 10, 2010 10:46 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Queue in Use:clearing messages
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.