Author |
Message
|
souciance |
Posted: Fri Jul 06, 2012 4:07 am Post subject: PCF command for channel properties |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
Hi,
Does anyone know if there is a PCF command to return all the properties for a given MQ channel? That is, using a simple loop you can return it's properties and their values..
Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 06, 2012 5:05 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You mean other than INQUIRE CHANNEL? |
|
Back to top |
|
 |
souciance |
Posted: Fri Jul 06, 2012 5:41 am Post subject: |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
The problem I am having is that for queue attributes for the reponse back you can use MQMessage [] response and from there loop through the queue attributes.
For channels it seems you have to use PCFMessage and it does not have the same methods available. Or am I misstaken here? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 06, 2012 6:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
No MQ application performing any business logic has any need to know anything about Channels
Start over.
what are you trying to do?
Why are you trying to do it? |
|
Back to top |
|
 |
souciance |
Posted: Fri Jul 06, 2012 6:36 am Post subject: |
|
|
Disciple
Joined: 29 Jun 2010 Posts: 169
|
At the moment I am simply playing around with some java code to understand the pcf structure better..
This is how my java code for channel attribute is looking:
Code: |
String[] channelTypes = {"", "SDR", "SVR", "RCVR", "RQSTR", "", "CLTCN", "SVRCN", "CLUSRCVR","CLUSSDR", ""};
String channelType="";
PCFMessage pcfPar = new PCFMessage(MQConstants.MQCMD_INQUIRE_CHANNEL);
pcfPar.addParameter(MQConstants.MQCACH_CHANNEL_NAME, channelName);
pcfParaddParameter(new MQCFIL (MQConstants.MQIACF_CHANNEL_ATTRS, new int[] {MQConstants.MQIACF_ALL}));
PCFMessage [] response;
response = agent.send(pcfPar);
|
channelName is the name of the channel which I get from a prevous method. The problem is, the when you use response[i], the method's available do not give that channel's properties.
Right now it seems I have to individually get them as such:
Code: |
System.out.println(response[index].getParameter(MQConstants.MQCACH_CHANNEL_START_DATE).getParameterName());
System.out.println(response[index].getParameter(MQConstants.MQCACH_CHANNEL_START_DATE).getValue()); |
Off course this is not good since some channels may not have some properties and that requires further checks etc..
I have it for queues but not able to make it for for channels.. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 06, 2012 7:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You can getParameters().
You're not going to get different coding options for the results of INQUIRE CHANNEL than you are for the results of INQUIRE QUEUE.
You might indeed get different coding options for inquiring after *all* channels, versus inquring after a *single* queue.
There are java sample programs for PCF that come with MQ. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Jul 09, 2012 2:39 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
mqjeff wrote: |
what are you trying to do?
Why are you trying to do it? |
souciance wrote: |
At the moment I am simply playing around with some java code to understand the pcf structure better. |
As you have discovered, PCF is an advanced topic. It's complicated.
ftp://ftp.software.ibm.com/software/integration/wmq/docs/V7.0/csqzac07.pdf or the equivalent InfoCenter documentation. _________________ 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 |
|
 |
|