2.2.2.3 MQACCESS

The MQACCESS enumeration defines values that indicate the requested access mode for opening a Queue. When a queue is opened for exclusive access, other clients of this protocol MUST NOT be permitted to open the same queue. Also, a client of this protocol MUST NOT acquire exclusive access to a queue that is already opened by any other client.

 typedef enum 
 {
   MQ_RECEIVE_ACCESS = 1,
   MQ_SEND_ACCESS = 2,
   MQ_PEEK_ACCESS = 0x0020,
   MQ_ADMIN_ACCESS = 0x0080
 } MQACCESS;

MQ_RECEIVE_ACCESS:  The OpenQueueDescriptor that is created by the IMSMQQueueInfo4::Open method represents permission granted by the QueueManager to read and delete Messages from the MessagePositionList contained by the Queue that is referenced by the OpenQueueDescriptor.

MQ_SEND_ACCESS:  The OpenQueueDescriptor that is created by the Open method represents permission granted by the QueueManager to insert new Messages into the MessagePositionList contained by the Queue that is referenced by the OpenQueueDescriptor. This value is not valid when combined with MQ_ADMIN_ACCESS.

MQ_PEEK_ACCESS:  The OpenQueueDescriptor that is created by the Open method represents permission granted by the QueueManager to read (but not delete) Messages from the MessagePositionList contained by the Queue that is referenced by the OpenQueueDescriptor.

MQ_ADMIN_ACCESS:  The MQ_ADMIN_ACCESS bit modifies the interpretation of the format name by the Open method. When specified, this value indicates that the OutgoingQueue that transfers to the ApplicationQueue that is identified by the specified format name is to be opened, rather than the ApplicationQueue itself.

Note the difference between MQSHARE and MQACCESS:

  • MQACCESS determines the access to messages within a queue, such as read-only or read/write access to messages.

  • MQSHARE specifies whether a client has exclusive access to a queue, thereby making the queue inaccessible to other clients.

Used by:

  • IMSMQQueueInfo::Open

The MQACCESS enumeration values correspond to the enumeration values for QueueAccessType as shown in the following table:

MQACCESS

QueueAccessType

MQ_RECEIVE_ACCESS

ReceiveAccess

MQ_SEND_ACCESS

SendAccess

MQ_PEEK_ACCESS

PeekAccess

MQ_ADMIN_ACCESS

PeekAdminAccess & ~PeekAccess