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 IBM MQ Support » How to drop connections to a queue

Post new topic  Reply to topic
 How to drop connections to a queue « View previous topic :: View next topic » 
Author Message
hp1411
PostPosted: Sat Oct 17, 2015 4:54 pm    Post subject: How to drop connections to a queue Reply with quote

Newbie

Joined: 17 Oct 2015
Posts: 9

Hello All,

I am a complete newbie to MQ and had a question regarding clearing messages of a queue.

I have noticed that the clear qlocal command will clear all the messages of a queue if there are no open connections.

Is there a way to drop all the connections to a queue so that I can clear it? OR if there a way to force a clear queue command?

Thanks!!
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Oct 17, 2015 7:06 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

If there are processes attached to the queue you usually use the MQExplorer to clear the queue doing a destructive get. Takes a little bit longer but works for a queue that is in use.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mo_lightapps
PostPosted: Sat Oct 17, 2015 7:44 pm    Post subject: Reply with quote

Novice

Joined: 12 Oct 2015
Posts: 18

You haven't said how the client is connected to the queue manager. I will assume that its a server connection channel. If so, you need to issue a stop channel command:

runmqsc <QMGR>
dis chs(<CHANNEL_NAME>)
stop channel(<CHANNEL_NAME>) mode(force)
dis chs(<CHANNEL_NAME>)

The dis chs command on either side of the stop channel will show you whether or not it worked. If that still doesnt work, change mode to "terminate".

Note that these commands are safe to run but may cause duplicates as they mess with the acknowledgement status of messages being published or consumed at the time the command is issued. Also this will take out connections to other queues as well (if that's the case here).
_________________
LightApps - Creators of Lighthouse software. Modern web based management of messaging systems IBM MQ and Solace - queue browsing, automated configuration deployment and monitoring.

www.lightapps.com.au
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Sun Oct 18, 2015 4:15 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2495
Location: Melbourne, Australia

fjb_saper wrote:
If there are processes attached to the queue you usually use the MQExplorer to clear the queue doing a destructive get. Takes a little bit longer but works for a queue that is in use.

Unless any processes have the queue open for exclusive input. Setting get inhibit on the queue might get rid of them.
_________________
Glenn


Last edited by gbaddeley on Tue Oct 20, 2015 3:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
mo_lightapps
PostPosted: Sun Oct 18, 2015 4:51 pm    Post subject: Reply with quote

Novice

Joined: 12 Oct 2015
Posts: 18

gbaddeley wrote:
fjb_saper wrote:
If there are processes attached to the queue you usually use the MQExplorer to clear the queue doing a destructive get. Takes a little bit longer but works for a queue that is in use.

Unless any processes have the queue open for exclusive input. Setting put inhibit on the queue might get rid of them.


Watch out for cases where the client has a handle and connection open for an extended period in which case it may not take affect until these are recycled.
_________________
LightApps - Creators of Lighthouse software. Modern web based management of messaging systems IBM MQ and Solace - queue browsing, automated configuration deployment and monitoring.

www.lightapps.com.au
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Oct 18, 2015 5:51 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9403
Location: US: west coast, almost. Otherwise, enroute.

You might want to use the DISPLAY QSTATUS (queue-name) TYPE(HANDLE)
to see which apps have the queue open.

As my colleague mentioned, if the app keeps the queue open for a extended time period, you can put/get inhibit the queue to cause the next use of the queue to fail. You might also want/need to use an o/s primitive command to cancel the application(s).
_________________
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: Mon Oct 19, 2015 4:21 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

gbaddeley wrote:
fjb_saper wrote:
If there are processes attached to the queue you usually use the MQExplorer to clear the queue doing a destructive get. Takes a little bit longer but works for a queue that is in use.

Unless any processes have the queue open for exclusive input. Setting put inhibit on the queue might get rid of them.

You're talking about exclusive input => I would have thought that implied a get inhibit?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Raman Kathpalia
PostPosted: Mon Oct 19, 2015 6:21 am    Post subject: Re: How to drop connections to a queue Reply with quote

Newbie

Joined: 22 Jan 2015
Posts: 9
Location: New York, New York

hp1411 wrote:
Hello All,

I am a complete newbie to MQ and had a question regarding clearing messages of a queue.

I have noticed that the clear qlocal command will clear all the messages of a queue if there are no open connections.

Is there a way to drop all the connections to a queue so that I can clear it? OR if there a way to force a clear queue command?

Thanks!!


If clearing queue is the only concern then you don't need to drop the IPPROCS and OPPROCS to achieve it.

Try:
Code:
dmpmqmsg -m QMGRNAME -I QUEUE_NAME -F /dev/null -p


http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_8.0.0/com.ibm.mq.ref.adm.doc/q117660_.htm

use /dev/null equivalent for your OS if it's not *nix based.

Assuming you're on one of newer versions of MQ.

Cheers!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
PeterPotkay
PostPosted: Mon Oct 19, 2015 3:14 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7716

mo_lightapps wrote:

The dis chs command on either side of the stop channel will show you whether or not it worked. If that still doesnt work, change mode to "terminate".


Potentially dangerous. Kills the amqrmppa process, which can have up to 64 threads...that's up to 63 other channels other than the one you want to stop that will also be killed. Also if you have an exit in play on the channels, how will that react when the channel process is abruptly killed.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Tue Oct 20, 2015 3:02 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2495
Location: Melbourne, Australia

fjb_saper wrote:
gbaddeley wrote:
fjb_saper wrote:
If there are processes attached to the queue you usually use the MQExplorer to clear the queue doing a destructive get. Takes a little bit longer but works for a queue that is in use.

Unless any processes have the queue open for exclusive input. Setting put inhibit on the queue might get rid of them.

You're talking about exclusive input => I would have thought that implied a get inhibit?

yeah, should have said get inhibit. I have edited my original post to protect the guilty. G.
_________________
Glenn
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Oct 20, 2015 8:30 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

gbaddeley wrote:

yeah, should have said get inhibit. I have edited my original post to protect the guilty. G.

No problem. That's why the more advanced users here catch each other's typos... so that the newbies might learn...
_________________
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 IBM MQ Support » How to drop connections to a queue
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.