MQGetMessageOptions
java.lang.Object | *- com.ibm.mq.MQGetMessageOptions
public class MQGetMessageOptions
extends Object
This class contains options that control the behavior of MQQueue.get().
The behavior of some of the options available in this class depends on the environment in which they are used. These elements are marked with a *.
Variables
- groupStatus*
- public char groupStatus
This is an output field that indicates whether the retrieved message is in a group, and if it is, whether it is the last in the group. Possible values are:
- MQC.MQGS_LAST_MSG_IN_GROUP
- Message is the last in the group. This is also the value returned if the group consists of only one message.
- MQC.MQGS_MSG_IN_GROUP
- Message is in a group, but is not the last in the group.
- MQC.MQGS_NOT_IN_GROUP
- Message is not in a group.
- matchOptions*
- public int matchOptions
Selection criteria that determine which message is retrieved. The following match options can be set:
- MQC.MQMO_MATCH_CORREL_ID
- Correlation id to be matched.
- MQC.MQMO_MATCH_GROUP_ID
- Group id to be matched.
- MQC.MQMO_MATCH_MSG_ID
- Message id to be matched.
- MQC.MQMO_MATCH_MSG_SEQ_NUMBER
- Match message sequence number.
- MQC.MQMO_NONE
- No matching required.
- options
- public int options
Options that control the action of MQQueue.get. Any or none of the following values can be specified. If more than one option is required, the values can be added together or combined using the bitwise OR operator.
- MQC.MQGMO_ACCEPT_TRUNCATED_MSG
- Allow truncation of message data.
- MQC.MQGMO_BROWSE_FIRST
- Browse from start of queue.
- MQC.MQGMO_BROWSE_MSG_UNDER_CURSOR*
- Browse message under browse cursor.
- MQC.MQGMO_BROWSE_NEXT
- Browse from the current position in the queue.
- MQC.MQGMO_CONVERT
- Request the application data to be converted, to conform to the characterSet and encoding attributes of the MQMessage, before the data is copied into the message buffer. Because data conversion is also applied as the data is retrieved from the message buffer, applications do not usually set this option.
Using this option can cause problems when converting from single byte character sets to double byte character sets. Instead, do the conversion using the readString, readLine, and writeString methods after the message has been delivered.
- MQC.MQGMO_FAIL_IF_QUIESCING
- Fail if the queue manager is quiescing.
- MQC.MQGMO_LOCK*
- Lock the message that is browsed.
- MQC.MQGMO_MARK_SKIP_BACKOUT*
- Allow a unit of work to be backed out without reinstating the message on the queue.
- MQC.MQGMO_MSG_UNDER_CURSOR
- Get message under browse cursor.
- MQC.MQGMO_NONE
- No other options have been specified; all options assume their default values.
- MQC.MQGMO_NO_SYNCPOINT
- Get message without syncpoint control.
- MQC.MQGMO_NO_WAIT
- Return immediately if there is no suitable message.
- MQC.MQGMO_SYNCPOINT
- Get the message under syncpoint control; the message is marked as being unavailable to other applications, but it is deleted from the queue only when the unit of work is committed. The message is made available again if the unit of work is backed out.
- MQC.MQGMO_SYNCPOINT_IF_PERSISTENT*
- Get message with syncpoint control if message is persistent.
- MQC.MQGMO_UNLOCK*
- Unlock a previously locked message.
- MQC.MQGMO_WAIT
- Wait for a message to arrive.
Segmenting and grouping
WebSphere MQ messages can be sent or received as a single entity, can be split into several segments for sending and receiving, and can also be linked to other messages in a group.Each piece of data that is sent is known as a physical message, which can be a complete logical message, or a segment of a longer logical message.
Each physical message usually has a different MsgId. All the segments of a single logical message have the same groupId value and MsgSeqNumber value, but the Offset value is different for each segment. The Offset field gives the offset of the data in the physical message from the start of the logical message. The segments usually have different MsgId values, because they are individual physical messages.
Logical messages that form part of a group have the same groupId value, but each message in the group has a different MsgSeqNumber value. Messages in a group can also be segmented.
The following options can be used for dealing with segmented or grouped messages:
- MQC.MQGMO_ALL_MSGS_AVAILABLE*
- Retrieve messages from a group only when all the messages in the group are available.
- MQC.MQGMO_ALL_SEGMENTS_AVAILABLE*
- Retrieve the segments of a logical message only when all the segments in the group are available.
- MQC.MQGMO_COMPLETE_MSG*
- Retrieve only complete logical messages.
- MQC.MQGMO_LOGICAL_ORDER*
- Return messages in groups, and segments of logical messages, in logical order.
- resolvedQueueName
- public String resolvedQueueName
This is an output field that the queue manager sets to the local name of the queue from which the message was retrieved. This is different from the name used to open the queue if an alias queue or model queue was opened.
- segmentation*
- public char segmentation
This is an output field that indicates whether or not segmentation is allowed for the retrieved message. Possible values are:
- MQC.MQSEG_INHIBITED
- Segmentation not allowed.
- MQC.MQSEG_ALLOWED
- Segmentation allowed.
- segmentStatus*
- public char segmentStatus
This is an output field that indicates whether the retrieved message is a segment of a logical message. If the message is a segment, the flag indicates whether or not it is the last segment. Possible values are:
- MQC.MQSS_LAST_SEGMENT
- Message is the last segment of the logical message. This is also the value returned if the logical message consists of only one segment.
- MQC.MQSS_NOT_A_SEGMENT
- Message is not a segment.
- MQC.MQSS_SEGMENT
- Message is a segment, but is not the last segment of the logical message.
- waitInterval
- public int waitInterval
The maximum time (in milliseconds) that an MQQueue.get call waits for a suitable message to arrive (used in conjunction with MQC.MQGMO_WAIT). A value of MQC.MQWI_UNLIMITED indicates that an unlimited wait is required.
Constructors
- MQGetMessageOptions
- public MQGetMessageOptions()
Construct a new MQGetMessageOptions object with options set to MQC.MQGMO_NO_WAIT, a wait interval of zero, and a blank resolved queue name.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.