java.lang.Object | +----com.ibm.mq.MQManagedObject | +----com.ibm.mq.MQQueue
MQQueue provides inquire, set, put and get operations for WebSphere MQ queues. The inquire and set capabilities are inherited from MQManagedObject.
Use MQQueueManager.accessQueue() to gain access to an MQQueue object.
public MQQueue(MQQueueManager qMgr, String queueName, int openOptions, String queueManagerName, String dynamicQueueName, String alternateUserId) throws MQException;
Public constructor which allows users to create MQQueue subclasses.
If more than one option is required, the values can be combined using either the '+' or '|' operator.
public void close() throws MQException;
Closes the object. No further operations on this object are permitted after it is closed. The behavior of the close method can be altered by setting closeOptions.
public void get(MQMessage message) throws MQException;
Retrieves a message from the queue, using default get message options. It uses an option setting of MQC.MQGMO_NO_WAIT.
public void get(MQMessage message, MQGetMessageOptions getMessageOptions) throws MQException;
Retrieves a message from the queue, regardless of the size of the message. For large messages, this might require two calls to WebSphere MQ, One to establish the required buffer size and one to get the message data itself.
If the call fails, the MQMessage object is unchanged. If it succeeds, the message descriptor fields and message data portions of the MQMessage are completely overwritten by the fields and data from the incoming message.
Note that if you perform a get with wait, all other threads using the same MQQueueManager are blocked until the call completes. If you need multiple threads to access WebSphere MQ simultaneously, then each thread must create its own MQQueueManager object.
public void get(MQMessage message, MQGetMessageOptions getMessageOptions, int MaxMsgSize) throws MQException;
Retrieves a message from the queue, up to a maximum specified message size.
If the call fails, the MQMessage object is unchanged. If it succeeds, the message descriptor fields and message data portions of the MQMessage are completely overwritten by the fields and data from the incoming message.
If you perform a get with wait, all other threads using the same MQQueueManager are blocked until the call completes. If you need multiple threads to access WebSphere MQ simultaneously, then each thread must create its own MQQueueManager object.
If the flag has been set, the message is filled with as much of the message data as will fit in the specified buffer size, and an MQException is thrown with completion code MQCC_WARNING and reason code MQRC_TRUNCATED_MSG_ACCEPTED.
If the flag has not been set, the message is left on the queue and an MQException is thrown with completion code MQCC_FAILED and reason code MQRC_TRUNCATED_MSG_FAILED.
public GregorianCalendar getCreationDateTime() throws MQException;
Gets the date and time that this queue was created.
public int getCurrentDepth() throws MQException;
Gets the number of messages currently on the queue. This value is incremented during a put call and during backout of a get call. It is decremented during a non-browse get and during backout of a put call.
public int getDefinitionType() throws MQException;
Indicates how the queue was defined.
public int getInhibitGet() throws MQException;
Indicates whether get operations are allowed for this queue.
public int getInhibitPut() throws MQException;
Indicates whether put operations are allowed for this queue.
public int getMaximumDepth() throws MQException;
Gets the maximum number of messages that can exist on the queue at any one time. An attempt to put a message to a queue that already contains this many messages fails with reason code MQException.MQRC_Q_FULL .
public int getMaximumMessageLength() throws MQException;
Gets the maximum length of the application data of a message on this queue. An attempt to put a message larger than this value fails with reason code MQException.MQRC_MSG_TOO_BIG_FOR_Q.
public int getOpenInputCount() throws MQException;
Gets the number of currently valid handles for removing messages from the queue.
public int getOpenOutputCount() throws MQException;
Gets the number of currently valid handles for adding messages to the queue.
public int getQueueType() throws MQException;
Gets the type of this queue.
public int getShareability() throws MQException;
Indicates whether the queue can be opened multiple times for input.
public int getTriggerControl() throws MQException;
Indicates whether trigger messages are written to an initiation queue. This starts an application to service the queue.
public String getTriggerData() throws MQException;
Gets the data for the trigger message that is written to the initiation queue. The trigger message is written to the initiation queue when a message arrives on this one.
public int getTriggerDepth() throws MQException;
Gets the number of messages that have to be on the queue to generate a trigger message. This applies when the trigger type is MQC.MQTT_DEPTH.
public int getTriggerMessagePriority() throws MQException;
Gets the message priority below which messages do not cause trigger messages. That is, the queue manager ignores these messages when deciding whether to generate a trigger.
public int getTriggerType() throws MQException;
Indicates the conditions under which trigger messages are written. Trigger messages are written as a result of messages arriving on this queue.
public void put(MQMessage message) throws MQException;
Puts a message onto the queue using default put message options.
public void put(MQMessage message, MQPutMessageOptions putMessageOptions) throws MQException;
Puts a message onto the queue.
Modifications to the MQMessage object after the put has completed do not affect the actual message on the queue.
If you use the same MQMessage object to make further calls, then performing a put updates MQMessage.messageId and MQMessage.correlationId.
Note also that calling put does not clear the message data. For example:
msg.writeString("a"); q.put(msg,pmo); msg.writeString("b"); q.put(msg,pmo);
results in "ab" being put by the second call.
public void setInhibitGet(int inhibit) throws MQException;
Controls whether get operations are allowed for this queue.
public void setInhibitPut(int inhibit) throws MQException;
Controls whether put operations are allowed for this queue.
public void setTriggerControl(int trigger) throws MQException;
Controls whether trigger messages are written to an initiation queue. This starts an application to service the queue.
public void setTriggerData(String data) throws MQException;
Sets the data for the trigger message that is written to the initiation queue. The trigger message is written to the initiation queue when a message arrives on this one.
public void setTriggerDepth(int depth) throws MQException;
Sets the number of messages that have to be on the queue to generate a trigger message. This applies when trigger type is MQC.MQTT_DEPTH .
public void setTriggerMessagePriority(int priority) throws MQException;
Sets the message priority below which messages do not cause trigger messages. That is, the queue manager ignores these messages when deciding whether to generate a trigger.
public void setTriggerType(int type) throws MQException;
Sets the conditions under which trigger messages are written. Trigger messages are written as a result of messages arriving on this queue.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csqzaw1354 |