MQ Objects
MQ Installations
MQ Distribution Setup
MQ Triggering
MQ Failure Messages
MQ Client-Server
MQI Calls
MQ Logs
MQ Clusters
MQ Object Properties
Websphere MQ Interview Questions




MQCLOSE - Close a WebSphere MQ object.

MQCLOSE call relinquishes access to an object. I.e, Object handle (HObj) will be deactivated. So if application wants to put the messages again then it needs to be re-open the queue with MQOPEN call CALL-MQCLOSE behavior-20170111074956.png


MQCLOSE (HConn, Hobj, Options, CompCode, Reason)


  • HConn & HObj – These are connection & Object handles supplied from successful MQConn/MQCONNX & MQOPEN calls.

  • Options – set of parameters for working with dynamic queues.

                    For ex:

                                While closing the queue object connection for permanent dynamic queue, we have option to delete the queue explicitly.

  • CompCode & Reason Code – MQI Call status & reason for the failure information is thrown here.


Sample error codes:

  • MQRC_NOT_AUTHORIZED - Not authorized for access.
  • MQRC_Q_NOT_EMPTY - Queue contains one or more messages or uncommitted put or get requests.