Reputation: 3581
When I try to get the queue names from a queue manager, I am getting this error which I couldn't understand why
PCFMessage reqeuestMessage = new PCFMessage(MQC.MQCMD_INQUIRE_Q);
reqeuestMessage.AddParameter(MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);
PCFMessage[] pcfResponse = messageAgent.Send(reqeuestMessage);
Upvotes: 2
Views: 1277
Reputation: 10652
IBM has stated that the PCF support that is included in the MQ Classes for .NET not documented or maintained. For reference look at Page 16 of the MQ Technical Conference v2.0.1.5 presentation "PCF Programming" by Mark Taylor of IBM MQ Development:
- Some use .Net classes: that interface is not documented or maintained
- An historic accident
- Missing newer function such as z/OS and byte string support
I verified that the PCF interface for the MQ classes for .NET is still not documented in the IBM MQ Knowledge center, but of interest is that they have take a few APARs in this area recently and resolved them:
Microsoft Developer All About Interop blog post "PCF with IBM’s MQ Classes for .NET" has some examples, you probably need to use MQCMD_INQUIRE_Q_NAMES
instead of MQC.MQCMD_INQUIRE_Q
. From the blog:
PCFMessageAgent agent = new PCFMessageAgent(c.MQ_QueueManager);
PCFMessage request= new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_NAMES);
request.AddParameter (MQC.MQCA_Q_NAME, queuename);
request.AddParameter (MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);
PCFMessage[] responses = agent.Send(request);
Another example is in @Sashi's answer to Stack Overflow question "MQ Statistics Monitoring from C#/.NET".
Upvotes: 2
Reputation: 7476
Where's the queue name parameter?
PCFMessage reqeuestMessage = new PCFMessage(MQC.MQCMD_INQUIRE_Q);
reqeuestMessage.AddParameter(MQC.MQCA_Q_NAME, "*");
reqeuestMessage.AddParameter(MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL);
reqeuestMessage.AddParameter(MQCFC.MQIACF_Q_ATTRS,
new int [] { MQC.MQCA_Q_NAME,
MQC.MQIA_Q_TYPE,
MQC.MQIA_CURRENT_Q_DEPTH,
MQC.MQIA_OPEN_INPUT_COUNT,
MQC.MQIA_OPEN_OUTPUT_COUNT });
PCFMessage[] pcfResponse = messageAgent.Send(reqeuestMessage);
You need to list what you are requesting AND what you want back from the request.
There are not many C# .NET PCF examples but there are hundreds or thousands of Java PCF examples. Just model your C# .NET code after the Java PCF code.
Upvotes: 0