Methods
- AccessQueue
public MQQueue AccessQueue(String queueName, int openOptions, String queueManagerName, String dynamicQueueName, String alternateUserId)Throws MQException.
Establishes access to a WebSphere MQ queue on this queue manager to get or browse messages, put messages, inquire about the attributes of the queue or set the attributes of the queue.
If the queue named is a model queue, a dynamic local queue is created. The name of the created queue can be determined from the
name attribute of the returned MQQueue object.
Parameters
- queueName
- Name of queue to open.
- openOptions
- Options that control the opening of the queue. Valid options are:
- MQC.MQOO_ALTERNATE_USER_AUTHORITY
- Validate with the specified user identifier.
- MQC.MQOO_BIND_AS_QDEF
- Use default binding for queue.
- MQC.MQOO_BIND_NOT_FIXED
- Do not bind to a specific destination.
- MQC.MQOO_BIND_ON_OPEN
- Bind handle to destination when queue is opened.
- MQC.MQOO_BROWSE
- Open to browse message.
- MQC.MQOO_FAIL_IF_QUIESCING
- Fail if the queue manager is quiescing.
- MQC.MQOO_INPUT_AS_Q_DEF
- Open to get messages using queue-defined default.
- MQC.MQOO_INPUT_SHARED
- Open to get messages with shared access.
- MQC.MQOO_INPUT_EXCLUSIVE
- Open to get messages with exclusive access.
- MQC.MQOO_INQUIRE
- Open for inquiry - required if you wish to query properties.
- MQC.MQOO_OUTPUT
- Open to put messages.
- MQC.MQOO_PASS_ALL_CONTEXT
- Allow all context to be passed.
- MQC.MQOO_PASS_IDENTITY_CONTEXT
- Allow identity context to be passed.
- MQC.MQOO_SAVE_ALL_CONTEXT
- Save context when message retrieved*.
- MQC.MQOO_SET
- Open to set attributes --required if you wish to set properties.
- MQC.MQOO_SET_ALL_CONTEXT
- Allows all context to be set.
- MQC.MQOO_SET_IDENTITY_CONTEXT
- Allows identity context to be set.
If more than one option is required, the values can be added together or combined using the bitwise OR operator. See the WebSphere MQ Application Programming Reference for a fuller description of these options.
- queueManagerName
- Name of the queue manager on which the queue is defined. A name that is entirely blank or null denotes the queue manager to which this MQQueueManager object is connected.
- dynamicQueueName
- This parameter is ignored unless queueName specifies the name of a model queue. If it does, this parameter specifies the name of the dynamic queue to be created. A blank or null name is not valid if queueName specifies the name of a model queue. If the last non-blank character in the name is an asterisk (*), the queue manager replaces the asterisk with a string of characters that guarantees that the name generated for the queue is unique on this queue manager.
- alternateUserId
- If MQOO_ALTERNATE_USER_AUTHORITY is specified in the openOptions parameter, this parameter specifies the alternate user identifier that is used to check the authorization for the open. If MQOO_ALTERNATE_USER_AUTHORITY is not specified, this parameter can be left blank (or null).
- Returns
- MQQueue that has been successfully opened.
Throws MQException if the open fails.
- AccessQueue
public MQQueue AccessQueue(String queueName, int openOptions)Throws MQException if you call this method after disconnecting from the queue manager.
Parameters
- queueName
- Name of queue to open
- openOptions
- Options that control the opening of the queue
See the description of MQQueueManager.AccessQueue for details of the parameters.
For this version of the method, queueManagerName, dynamicQueueName, and alternateUserId are set to "".
- Returns
- MQQueue that has been successfully opened.
Throws MQException if the open fails.
- Backout
public void Backout()Throws MQException.
Calling this method indicates to the queue manager that all the message gets and puts that have occurred since the last syncpoint are to be backed out. Messages put as part of a unit of work (with the MQC.MQPMO_SYNCPOINT flag set in the options field of MQPutMessageOptions) are deleted; messages retrieved as part of a unit of work (with the MQC.MQGMO_SYNCPOINT flag set in the options field of MQGetMessageOptions) are reinstated on the queue.
See also the description of the commit method.
- Begin*
public void Begin()
Throws MQException.
This method is supported only by the WebSphere MQ classes for .NET in server bindings mode. It signals to the queue manager that a new unit of work is starting.
Do not use this method for applications that use local one-phase transactions.
- Commit
public void Commit()Throws MQException.
Calling this method indicates to the queue manager that the application has reached a syncpoint, and that all the message gets and puts that have occurred since the last syncpoint are to be made permanent. Messages put as part of a unit of work (with the MQC.MQPMO_SYNCPOINT flag set in the options field of MQPutMessageOptions) are made available to other applications. Messages retrieved as part of a unit of work (with the MQC.MQGMO_SYNCPOINT flag set in the options field of MQGetMessageOptions) are deleted.
See also the description of the backout method.
- Disconnect
public void Disconnect()Throws MQException.
Terminates the connection to the queue manager. All open queues and processes accessed by this queue manager are closed, and become unusable. When you have disconnected from a queue manager, the only way to reconnect is to create a new MQQueueManager object.
Normally, any work performed as part of a unit of work is committed. However, if this connection is managed by a ConnectionManager, rather than an MQConnectionManager, the unit of work might be rolled back.
- Put
public void Put(String qName, String qmName, MQMessage msg, MQPutMessageOptions pmo, String altUserId)Throws MQException.Places a single message onto a queue without having to create an MQQueue object first.
The qName (queue name) and qmName (queue manager name) parameters identify where the message is placed. If the queue is a model queue, an MQException is thrown.
In other respects, this method behaves like the put method on the MQQueue object. It is an implementation of the MQPUT1 MQI call. See MQQueue.Put.
Parameters
- qName
- The name of the queue onto which to place the message.
- qmName
- The name of the queue manager on which the queue is defined.
- msg
- The message to send.
- pmo
- Options controlling the actions of the put. See MQPutMessageOptions for more details.
- altUserid
- Specifies an alternative user identifier used to check authorization when placing the message on a queue. If you do not specify MQPMO_ALTERNATE_USER, this parameter is ignored.
- Put
public void Put(String qName, String qmName, MQMessage msg, MQPutMessageOptions pmo)Throws MQException.Places a single message onto a queue without having to create an MQQueue object first.
This version of the method allows you to omit the altUserid parameter. See the fully-specified method (MQQueueManager.Put) for details of the parameters.
- Put
public void Put(String qName, String qmName, MQMessage msg)Throws MQException.Places a single message onto a queue without having to create an MQQueue object first.
This version of the method allows you to omit the put message options (pmo) and altUserid parameters. See the fully-specified method (MQQueueManager.Put) for details of the parameters.
- Put
public void Put(String qName, MQMessage msg, MQPutMessageOptions pmo)Throws MQException.Places a single message onto a queue without having to create an MQQueue object first.
This version of the method allows you to omit the qmName and altUserid parameters. See the fully-specified method (MQQueueManager.Put) for details of the parameters.
- Put
public void Put(String qName, MQMessage msg)Throws MQException.Places a single message onto a queue without having to create an MQQueue object first.
This version of the method allows you to omit the qmName, put message options (pmo), and altUserid parameters. See the fully-specified method (MQQueueManager.Put) for details of the parameters.
csqzav0568