3

I am using MQ PCF command in Java to create MQ queues and updating their parameters. Following is the code I am using.

PCFMessageAgent agent = new PCFMessageAgent(queueManager);
agent.setCheckResponses(false);
PCFMessage[] responses;
PCFMessage request = new PCFMessage(MQConstants.MQCMD_CHANGE_Q);
responses = agent.send(request);

I am setting the following attributes on the request

MQCA_Q_NAME=TestTQ1
MQIA_BACKOUT_THRESHOLD=0
MQIA_MAX_MSG_LENGTH=4194304
MQIA_MAX_Q_DEPTH=500
MQIA_Q_TYPE=1

and I get the following response Completion Code = 2 Reason Code = 3014
Documentation says that this is due to

Parameter identifier is not valid.
The MQCFIN or MQCFIN64 Parameter field value was not valid.

The question is how do I know which parameter is incorrect?

A j
  • 1,069
  • 2
  • 16
  • 29
  • I have marked the correct response. It turns out that this works fine when I order the attributes such that MQCA_Q_NAME and MQIA_Q_TYPE are the first two attributes in the request. – A j Nov 23 '15 at 20:02

1 Answers1

1

The first PCFMessage in responses should have one PCFParamter, which should be a MQCFIN, whose type is MQIACF_PARAMETER_ID and whose value will contain the ID of the attribute that the error is on.

int errParamId = responses[0].getIntParameterValue(MQC.MQIACF_PARAMETER_ID);
DBug
  • 2,502
  • 1
  • 12
  • 25
  • I tried this and the problem attribute is MQIA_MAX_Q_DEPTH. The documentation says that I can pass this value when creating and updating queues. Any ideas? – A j Nov 23 '15 at 12:19
  • I believe if there were multiple attribute with errors, then there would be multiple responses, one per attribute. As for whether values are valid, it depends on the platform the qmgr is running on. – DBug Nov 23 '15 at 14:25