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 » Help need in PCF programming to exclude the SYSTEM queues

Post new topic  Reply to topic
 Help need in PCF programming to exclude the SYSTEM queues « View previous topic :: View next topic » 
Author Message
madhura.illendula
PostPosted: Thu Mar 12, 2015 1:17 pm    Post subject: Help need in PCF programming to exclude the SYSTEM queues Reply with quote

Newbie

Joined: 12 Mar 2015
Posts: 2

I am trying to get user defined queues(excluding SYSTEM objects and Temporary queues like AMQ.XXXXXX) using PCF programming can any one please tell me how can I get that. When I use the following code it gives me all the objects.

Code:
         PCFMessage pcfCmd1 = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);
          pcfCmd1.addParameter(MQConstants.MQCA_Q_NAME, "*");
          pcfCmd1.addFilterParameter(MQConstants.MQCA_Q_NAME, CMQCFC.MQCFOP_NOT_LIKE, "SYSTEM.*");
          
           pcfCmd1.addParameter(MQConstants.MQIACF_Q_ATTRS, new int[] {
                 MQConstants.MQCA_Q_NAME,
                    MQConstants.MQIA_MAX_Q_DEPTH,
                    MQConstants.MQIA_CURRENT_Q_DEPTH,
                    MQConstants.MQIA_INHIBIT_PUT});
           
          PCFMessage[] pcfResponse1 = pcfCM.agent.send(pcfCmd1);
          for (PCFMessage pcfMessage : pcfResponse1) {
               String names = (String) pcfMessage
                            .getParameterValue(MQConstants.MQCA_Q_NAME);
               System.out.println("names::"+names);
           }
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Thu Mar 12, 2015 1:31 pm    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

One of the rather annoying restrictions of the WHERE clause is that you can't use the object name in the expression.

It depends on what you are trying to do of course. However, you can do this easily using MQGem MQSCX product.

The command would be simply.....

Code:
dis q(*) =where(queue nl "SYSTEM.*" & deftype != "TEMPDYN")


Cheers,
Paul.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
mqjeff
PostPosted: Fri Mar 13, 2015 4:38 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You should be able to use the where clause to eliminate the dynamic queues. I've not checked the documentation, though, so that might be wildly wrong.

You will otherwise have to loop through the objects that are returned and either skip or remove the ones that start with SYSTEM.
Back to top
View user's profile Send private message
madhura.illendula
PostPosted: Mon Mar 16, 2015 1:12 pm    Post subject: Reply with quote

Newbie

Joined: 12 Mar 2015
Posts: 2

Thank you all for responding to my post. I can loop through and exclude AMQ & SYSTEM objects. But I will be interested if you can help me in fixing the following code or equivalent code which helps to exclude the SYSTEM & AMQ objects.

PCFMessage pcfCmd1 = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);
pcfCmd1.addParameter(MQConstants.MQCA_Q_NAME, "*");
pcfCmd1.addFilterParameter(MQConstants.MQCA_Q_NAME, CMQCFC.MQCFOP_NOT_LIKE, "SYSTEM.*");
Back to top
View user's profile Send private message
PaulClarke
PostPosted: Mon Mar 16, 2015 11:52 pm    Post subject: Reply with quote

Grand Master

Joined: 17 Nov 2005
Posts: 1002
Location: New Zealand

Did you actually read my previous answer? I don't believe the WHERE clause allows you to do what you are trying to do.

As an experiment try and do what you want to do in MQSC
Code:
dis q(*) where(queue nl 'SYS*')


I believe it will complain about the attribute. Where as

Code:
dis q(*) where(descr nl 'SYS*')


is perfectly legal.

As I said before.....annoying. Although I use MQSCX so not an issue for me.
_________________
Paul Clarke
MQGem Software
www.mqgem.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Help need in PCF programming to exclude the SYSTEM 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.