I am listening for messages from an IBM MQ using .Net. When it sees a message it removes the message from the queue automatically. I want to check the schema of the message first. If its not the correct schema I am looking for I want to keep it in the queue.
How do I alter the code to not automatically remove the message from the queue when a message is found?
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING;
IBM.WMQ.MQQueueManager mqManager = new IBM.WMQ.MQQueueManager(qmName);
MQQueue queue = mqManager.AccessQueue(queueName, openOptions);
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_WAIT;
gmo.WaitInterval = MQC.MQWI_UNLIMITED;
queue.Get(message, gmo);
//Only remove message from the queue if a schema check of the message has passed