I have used the below code to inhibit the queue but when I try to inhibit I got the error.
I have tried various open options for the particular queue but still i have the issue. what else i missed in my code;
public void control(String mgrName, String queueName, int openOptions, string option)throws MQException{
qMgr = new MQQueueManager(mgrName);
mqQueue = qMgr.accessQueue(queueName, openOptions);
if (option.equalsIgnoreCase("stop")){
System.out.println("Stop mesage received");
mqQueue.setInhibitGet(MQC.MQQA_GET_INHIBITED);
System.out.println("Queue inhibitted successfully");
}else if(option.equalsIgnoreCase("start")){
System.out.println("Start mesage received");
mqQueue.setInhibitGet(MQC.MQQA_GET_ALLOWED);
System.out.println("Queue get allowed successfully");
}
}
I have got the below Error when call this method.
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2040