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 » IBM MQ Java / JMS » Deleting queues

Post new topic  Reply to topic
 Deleting queues « View previous topic :: View next topic » 
Author Message
deeps1281
PostPosted: Mon Mar 13, 2006 5:44 am    Post subject: Deleting queues Reply with quote

Apprentice

Joined: 31 Aug 2005
Posts: 29

Hi

I need to write a sample application which will allow me to delete some of the temperory queues that are created everyday in our testing environment.The number of queues is too large to be deleted manually.
I was suggested PCF messages but i could not find a suitable reference on which i could work further.

I was able to access all the queue names using
PCFMessageAgent agent = new PCFMessageAgent(qMgrIP, qMgrPort, qMgrChannel);
PCFMessage request = new PCFMessage(1;
request.addParameter(2016, "*");
request.addParameter(20, 1001);
PCFMessage responses[] = agent.send(request);
qNames = (String[])responses[0].getParameterValue(3011);

Though i still have no idea how that happened.
Could some one build on it and let me know how i can delete the accessed fields.

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Mon Mar 13, 2006 5:57 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

That's a horrible example. I can see why it has confused you.

Go back and download the MS0B support pack again - it's the Java classes for PCF that are being used by your sample code there.

In that distribution is a set of sample code, that includes one that will list the queue names - so it will be the same function as the one you already have - but it will a) use the MQ Constansts by name instead of directly so it will be easier to understand and b) be much better documented.

Then, once you understand how the ListQueues code works, you can start work on your "delete queues" script.

The only thing that will be really different about your script is the PCF command you send and the response you get. The command you need to send is fully described in the Programmable Commands Format manual
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzac.doc/csqzac04.htm
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Mon Mar 13, 2006 9:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Wouldn't it be a LOT easier just to write a simple shell script to do this... I assume you know the names of the queues by some pattern that you could grep out ..... if its windows, a kit for doing grep awk sed was previously posted.....[/code]
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
jefflowrey
PostPosted: Mon Mar 13, 2006 10:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

wschutz wrote:
Wouldn't it be a LOT easier just to write a simple shell script to do this...

Only if deeps1281 knows shell script and grep and awk and ...

If deeps1281 only knows Java, then using MS0B is going to be a lot easier.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
wschutz
PostPosted: Mon Mar 13, 2006 11:23 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

easy:
Code:
echo "dis ql(*)" | runmqsc | egrep "QUEUE\(TEST.*\) *TYPE\(QLOCAL\)" | awk '{print $1}' | sed -e "s/QUEUE(\(.*\))/DELETE QLOCAL\(\1\)/" | runmqsc

deletes all local queues that start with TEST*
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
fjb_saper
PostPosted: Mon Mar 13, 2006 4:52 pm    Post subject: Reply with quote

Grand High Poobah

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

Guys,

I believe the more important issue here is WHY is his environment burdened with temporary queues that did not get deleted at the end of the day.

Could it be that his applications are creating permanent temporary queues ?

Something need to be done as well to stop the problem from happening not just treat the symptom...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Mon Mar 13, 2006 5:00 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

FJ -
deeps1281 said "testing environment".

I assumed that these were queues that were being manually created by a development group of some sort, and not being reused at a later point nor manually cleaned up. And that deeps1281 wanted some sort of a quick "delete this list of queues" tool.

Otherwise, yeah. Permanent dynamic queues are probably not what's wanted. And deleting temporary dynamic queues out from under a running application may not be a good idea.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
LearnMQSI
PostPosted: Fri Apr 07, 2006 8:22 am    Post subject: Reply with quote

Centurion

Joined: 20 Aug 2002
Posts: 137

Hi wschutz,

I tried your script and this is what output I get it.
*******************
Starting MQSC for queue manager EIDC.


No MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
*******************

But, the queues that I was trying to delete, they did not get deleted.

I put your script in a file and I just ran that file by simply typing the file name on the promp on AIX box. Did I ran it correctly????

Thank you
_________________
IBM Certified System Administrator - WebSphere MQ 5.3
Back to top
View user's profile Send private message
wschutz
PostPosted: Fri Apr 07, 2006 8:29 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Try it without the last runmqsc:
Code:
echo "dis ql(*)" | runmqsc | egrep "QUEUE\(TEST.*\) *TYPE\(QLOCAL\)" | awk '{print $1}' | sed -e "s/QUEUE(\(.*\))/DELETE QLOCAL\(\1\)/"

You should get something like:
Quote:
[wschutz@wschutz ~]$ echo "dis ql(*)" | runmqsc TEST | egrep "QUEUE\(TEST.*\) *TYPE\(QLOCAL\)" | awk '{print $1}' | sed -e "s/QUEUE(\(.*\))/DELETE QLOCAL\(\1\)/"
DELETE QLOCAL(TEST)
DELETE QLOCAL(TEST1)
[wschutz@wschutz ~]$
if your not using the default qmgr, you need to provide it on the runmqsc command.....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Deleting queues
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.