|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Help need in PCF programming to exclude the SYSTEM queues |
« View previous topic :: View next topic » |
Author |
Message
|
madhura.illendula |
Posted: Thu Mar 12, 2015 1:17 pm Post subject: Help need in PCF programming to exclude the SYSTEM queues |
|
|
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 |
|
 |
PaulClarke |
Posted: Thu Mar 12, 2015 1:31 pm Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Fri Mar 13, 2015 4:38 am Post subject: |
|
|
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 |
|
 |
madhura.illendula |
Posted: Mon Mar 16, 2015 1:12 pm Post subject: |
|
|
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 |
|
 |
PaulClarke |
Posted: Mon Mar 16, 2015 11:52 pm Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|