ImqMessageTracker C++ class

This class encapsulates those attributes of an ImqMessage or ImqQueue object that can be associated with either object.

Figure 1. ImqMessageTracker class
A Booch class diagram showing the ImqMessageTracker class and its parent class, ImqError.

Object attributes

accounting token
A binary value (MQBYTE32) of length MQ_ACCOUNTING_TOKEN_LENGTH. The initial value is MQACT_NONE.
correlation id
A binary value (MQBYTE24) of length MQ_CORREL_ID_LENGTH that you assign to correlate messages. The initial value is MQCI_NONE. The additional value, MQCI_NEW_SESSION, is possible.
feedback
Feedback information to be sent with a message. The initial value is MQFB_NONE. The following additional values are possible:
  • MQFB_SYSTEM_FIRST
  • MQFB_SYSTEM_LAST
  • MQFB_APPL_FIRST
  • MQFB_APPL_LAST
  • MQFB_COA
  • MQFB_COD
  • MQFB_EXPIRATION
  • MQFB_PAN
  • MQFB_NAN
  • MQFB_QUIT
  • MQFB_DATA_LENGTH_ZERO
  • MQFB_DATA_LENGTH_NEGATIVE
  • MQFB_DATA_LENGTH_TOO_BIG
  • MQFB_BUFFER_OVERFLOW
  • MQFB_LENGTH_OFF_BY_ONE
  • MQFB_IIH_ERROR
  • MQFB_NOT_AUTHORIZED_FOR_IMS
  • MQFB_IMS_ERROR
  • MQFB_IMS_FIRST
  • MQFB_IMS_LAST
  • MQFB_CICS_APPL_ABENDED
  • MQFB_CICS_APPL_NOT_STARTED
  • MQFB_CICS_BRIDGE_FAILURE
  • MQFB_CICS_CCSID_ERROR
  • MQFB_CICS_CIH_ERROR
  • MQFB_CICS_COMMAREA_ERROR
  • MQFB_CICS_CORREL_ID_ERROR
  • MQFB_CICS_DLQ_ERROR
  • MQFB_CICS_ENCODING_ERROR
  • MQFB_CICS_INTERNAL_ERROR
  • MQFB_CICS_NOT_AUTHORIZED
  • MQFB_CICS_UOW_BACKED_OUT
  • MQFB_CICS_UOW_ERROR

You can also use an application-specific string of your choice. For more information about this, see the Feedback (MQLONG) for MQMD field of the message descriptor (MQMD).

group id
A binary value (MQBYTE24) of length MQ_GROUP_ID_LENGTH unique within a queue. The initial value is MQGI_NONE.
message id
A binary value (MQBYTE24) of length MQ_MSG_ID_LENGTH unique within a queue. The initial value is MQMI_NONE.

Constructors

ImqMessageTracker( );
The default constructor.
ImqMessageTracker( const ImqMessageTracker & tracker );
The copy constructor. See the operator = method for details.

Object methods (public)

void operator = ( const ImqMessageTracker & tracker );
Copies instance data from tracker, replacing the existing instance data.
ImqBinary accountingToken ( ) const ;
Returns a copy of the accounting token.
ImqBoolean setAccountingToken ( const ImqBinary & token );
Sets the accounting token. The data length of token must be either zero or MQ_ACCOUNTING_TOKEN_LENGTH. This method returns TRUE if successful.
void setAccountingToken ( const MQBYTE32 token = 0 );
Sets the accounting token. token can be zero, which is the same as specifying MQACT_NONE. If token is nonzero, it must address MQ_ACCOUNTING_TOKEN_LENGTH bytes of binary data. When using predefined values such as MQACT_NONE, you might need to make a cast to ensure a signature match; for example, (MQBYTE *)MQACT_NONE.
ImqBinary correlationId ( ) const ;
Returns a copy of the correlation id.
ImqBoolean setCorrelationId ( const ImqBinary & token );
Sets the correlation id. The data length of token must be either zero or MQ_CORREL_ID_LENGTH. This method returns TRUE if successful.
void setCorrelationId ( const MQBYTE24 id = 0 );
Sets the correlation id. id can be zero, which is the same as specifying MQCI_NONE. If id is nonzero, it must address MQ_CORREL_ID_LENGTH bytes of binary data. When using predefined values such as MQCI_NONE, you might need to make a cast to ensure a signature match; for example, (MQBYTE *)MQCI_NONE.
MQLONG feedback ( ) const ;
Returns the feedback.
void setFeedback ( const MQLONG feedback );
Sets the feedback.
ImqBinary groupId ( ) const ;
Returns a copy of the group id.
ImqBoolean setGroupId ( const ImqBinary & token );
Sets the group id. The data length of token must be either zero or MQ_GROUP_ID_LENGTH. This method returns TRUE if successful.
void setGroupId ( const MQBYTE24 id = 0 );
Sets the group id. id can be zero, which is the same as specifying MQGI_NONE. If id is nonzero, it must address MQ_GROUP_ID_LENGTH bytes of binary data. When using predefined values such as MQGI_NONE, you might need to make a cast to ensure a signature match, for example (MQBYTE *)MQGI_NONE.
ImqBinary messageId ( ) const ;
Returns a copy of the message id.
ImqBoolean setMessageId ( const ImqBinary & token );
Sets the message id. The data length of token must be either zero or MQ_MSG_ID_LENGTH. This method returns TRUE if successful.
void setMessageId ( const MQBYTE24 id = 0 );
Sets the message id. id can be zero, which is the same as specifying MQMI_NONE. If id is nonzero, it must address MQ_MSG_ID_LENGTH bytes of binary data. When using predefined values such as MQMI_NONE, you might need to make a cast to ensure a signature match, for example (MQBYTE *)MQMI_NONE.

Reason codes

  • MQRC_BINARY_DATA_LENGTH_ERROR