ImqGetMessageOptions C++ class

This class encapsulates the MQGMO data structure

Figure 1. ImqGetMessageOptions class


Object attributes

    group status
    Status of a message for a group of messages. The initial value is MQGS_NOT_IN_GROUP. The following additional values are possible:

    • MQGS_MSG_IN_GROUP
    • MQGS_LAST_MSG_IN_GROUP

    match options
    Options for selecting incoming messages. The initial value is MQMO_MATCH_MSG_ID | MQMO_MATCH_CORREL_ID. The following additional values are possible:

    • MQMO_GROUP_ID
    • MQMO_MATCH_MSG_SEQ_NUMBER
    • MQMO_MATCH_OFFSET
    • MQMO_MSG_TOKEN
    • MQMO_NONE

    message token
    Message token. A binary value (MQBYTE16) of length MQ_MSG_TOKEN_LENGTH. The initial value is MQMTOK_NONE.

    options
    Options applicable to a message. The initial value is MQGMO_NO_WAIT. The following additional values are possible:

    resolved queue name
    Resolved queue name. This attribute is read-only. Names are never longer than 48 characters and can be padded to that length with nulls. The initial value is a null string.

    returned length
    Returned length. The initial value is MQRL_UNDEFINED. This attribute is read-only.

    segmentation
    The ability to segment a message. The initial value is MQSEG_INHIBITED. The additional value, MQSEG_ALLOWED, is possible.

    segment status
    The segmentation status of a message. The initial value is MQSS_NOT_A_SEGMENT. The following additional values are possible:

    • MQSS_SEGMENT
    • MQSS_LAST_SEGMENT

    syncpoint participation
    TRUE when messages are retrieved under syncpoint control.

    wait interval
    The length of time that the class get method pauses while waiting for a suitable message to arrive, if one is not already available. The initial value is zero, which effects an indefinite wait. The additional value, MQWI_UNLIMITED, is possible. This attribute is ignored unless the options include MQGMO_WAIT.


Constructors

    ImqGetMessageOptions( );
    The default constructor.

    ImqGetMessageOptions( const ImqGetMessageOptions & gmo );
    The copy constructor.


Object methods (public)

    void operator = ( const ImqGetMessageOptions & gmo );
    Copies instance data from gmo, replacing the existing instance data.

    MQCHAR groupStatus ( ) const ;
    Returns the group status.

    void setGroupStatus ( const MQCHAR status );
    Sets the group status.

    MQLONG matchOptions ( ) const ;
    Returns the match options.

    void setMatchOptions ( const MQLONG options );
    Sets the match options.

    ImqBinary messageToken( ) const;
    Returns the message token.

    ImqBoolean setMessageToken( const ImqBinary & token );
    Sets the message token. The data length of token must be either zero or MQ_MSG_TOKEN_LENGTH. This method returns TRUE if successful.

    void setMessageToken( const MQBYTE16 token = 0 );
    Sets the message token. token can be zero, which is the same as specifying MQMTOK_NONE. If token is nonzero, then it must address MQ_MSG_TOKEN_LENGTH bytes of binary data.

    When using predefined values, such as MQMTOK_NONE, you might not need to make a cast to ensure a signature match, for example (MQBYTE *)MQMTOK_NONE.

    MQLONG options ( ) const ;
    Returns the options.

    void setOptions ( const MQLONG options );
    Sets the options, including the syncpoint participation value.

    ImqString resolvedQueueName ( ) const ;
    Returns a copy of the resolved queue name.

    MQLONG returnedLength( ) const;
    Returns the returned length.

    MQCHAR segmentation ( ) const ;
    Returns the segmentation.

    void setSegmentation ( const MQCHAR value );
    Sets the segmentation.

    MQCHAR segmentStatus ( ) const ;
    Returns the segment status.

    void setSegmentStatus ( const MQCHAR status );
    Sets the segment status.

    ImqBoolean syncPointParticipation ( ) const ;
    Returns the syncpoint participation value, which is TRUE if the options include either MQGMO_SYNCPOINT or MQGMO_SYNCPOINT_IF_PERSISTENT.

    void setSyncPointParticipation ( const ImqBoolean sync );
    Sets the syncpoint participation value. If sync is TRUE, alters the options to include MQGMO_SYNCPOINT, and to exclude both MQGMO_NO_SYNCPOINT and MQGMO_SYNCPOINT_IF_PERSISTENT. If sync is FALSE, alters the options to include MQGMO_NO_SYNCPOINT, and to exclude both MQGMO_SYNCPOINT and MQGMO_SYNCPOINT_IF_PERSISTENT.

    MQLONG waitInterval ( ) const ;
    Returns the wait interval.

    void setWaitInterval ( const MQLONG interval );
    Sets the wait interval.


Object methods (protected)

    static void setVersionSupported ( const MQLONG );
    Sets the MQGMO version. Defaults to MQGMO_VERSION_3.


Object data (protected)

    MQGMO omqgmo
    An MQGMO Version 2 data structure. Access MQGMO fields supported for MQGMO_VERSION_2 only.

    PMQGMO opgmo
    The address of an MQGMO data structure. The version number for this address is indicated in olVersion. Inspect the version number before accessing MQGMO fields, to ensure that they are present.

    MQLONG olVersion
    The version number of the MQGMO data structure addressed by opgmo.


Reason codes

  • MQRC_BINARY_DATA_LENGTH_ERROR

Parent topic: IBM MQ C++ classes