MQGetMessageOptions.NET class
Use MQGetMessageOptions to specify how messages are retrieved. It modifies the behavior of MQDestination.Get.
Class
System.Object | └─ IBM.WMQ.MQBase | └─ IBM.WMQ.MQBaseObject | └─ IBM.WMQ.MQGetMessageOptionspublic class IBM.WMQ.MQGetMessageOptions extends IBM.WMQ.MQBaseObject;
Properties
Note: 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 an asterisk *.Test for MQException being thrown when getting properties.
- public int GroupStatus {get;}*
- GroupStatus indicates whether the retrieved message is in a group and if it is the last in the group. Possible values are:
- MQC.MQGS_LAST_MSG_IN_GROUP
- Message is the last or only message in the group.
- 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.
- public int MatchOptions {get; set;}*
- MatchOptions determines how a message is selected. 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.
- public int Options {get; set;}
- Options control the action of MQQueue.get. Any of the following values can be specified. If more than one option is required, the values can be added, or combined using the bitwise OR operator.
- MQC.MQGMO_ACCEPT_TRUNCATED_MSG
- Allow truncation of message data.
- 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_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_COMPLETE_MSG*
- Retrieve only complete logical messages.
- 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 when the data is retrieved from the message buffer, applications do not set this option.
Use 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_LOGICAL_ORDER*
- Return messages in groups, and segments of logical messages, in logical order.
- 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_PROPERTIES
- No properties of the message, except properties contained in the message descriptor (or extension) are retrieved.
- MQC.MQGMO_NO_SYNCPOINT
- Get message without sync point control.
- MQC.MQGMO_NO_WAIT
- Return immediately if there is no suitable message.
- MQC.MQGMO_PROPERTIES_AS_Q_DEF
- Retrieve message properties as defined by the PropertyControl attribute of MQQueue. Access to the message properties in the message descriptor, or extension, are not affected by the PropertyControl attribute.
- MQC.MQGMO_PROPERTIES_COMPATIBILITY
- Retrieve message properties with a prefix of mcd, jms, usr, or mqext, in MQRFH2 headers. Other properties of the message, except properties contained in the message descriptor, or extension, are discarded.
- MQC.MQGMO_PROPERTIES_FORCE_MQRFH2
- Retrieve message properties, except properties contained in the message descriptor, or extension, in MQRFH2 headers. Use MQC.MQGMO_PROPERTIES_FORCE_MQRFH2 in applications that are expecting to retrieve properties but cannot be changed to use message handles.
- MQC.MQGMO_PROPERTIES_IN_HANDLE
- Retrieve message properties using a MsgHandle.
- MQC.MQGMO_SYNCPOINT
- Get the message under sync point 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 sync point control if message is persistent.
- MQC.MQGMO_UNLOCK*
- Unlock a previously locked message.
- MQC.MQGMO_WAIT
- Wait for a message to arrive.
- public string ResolvedQueueName {get;}
- The queue manager sets ResolvedQueueName to the local name of the queue from which the message was retrieved. ResolvedQueueName is different from the name used to open the queue if an alias queue or model queue was opened.
- public char Segmentation {get;}*
- Segmentation indicates whether we can allow segmentation for the retrieved message. Possible values are:
- MQC.MQSEG_INHIBITED
- Do not allow segmentation.
- MQC.MQSEG_ALLOWED
- Allow segmentation
- public byte SegmentStatus {get;}*
- SegmentStatus 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 it is the last segment. Possible values are:
- MQC.MQSS_LAST_SEGMENT
- Message is the last or only segment of the logical message.
- 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.
- public int WaitInterval {get; set;}
- WaitInterval is the maximum time in milliseconds that an MQQueue.get call waits for a suitable message to arrive. Use WaitInterval with MQC.MQGMO_WAIT. Set a value of MQC.MQWI_UNLIMITED to wait an unlimited time for a message.
Constructors
- public MQGetMessageOptions()
- Construct a new MQGetMessageOptions object with Options set to MQC.MQGMO_NO_WAIT, WaitInterval set to zero, and ResolvedQueueName set to blank.