These global variables provide application programs with access to message information from the most recent message sent or received.
Contains correlation from last message sent or read.
MQ – MQ does not verify whether @@msgcorrelation consists of printable characters. Application programs should not rely on @@msgcorrelation being in the current server character set, and should use @@msgcorrelation only as a selector for subsequent messages. If @@msgcorrelation is to be returned to the application, convert it to a varbinary datatype.
TIBCO JMS – @@msgcorrelation contains the correlationId from the the most recent message sent or received.
Contains message header information from the most recent message received. This variable’s format is in XML. For details about this format, see “<msgheader> and <msgproperties> documents”.
Functions that set @@msgheader include msgrecv and msgconsume.
Property name |
Description |
---|---|
ApplIdentityData |
Application data relating to identity. |
ApplOriginData |
Application data relating to origin. |
CodedCharSetId |
Numeric-coded character set identifier. |
CorrelId |
Correlation identifier. |
Encoding |
Encoding of binary data in the message. Bit mask of flags in the Encoding field. |
DecimalEncoding |
This is the encoding for decimal numbers in the message payload, and is a synthesized property derived from the Encoding field. If:
|
Feedback |
Feedback status. |
FloatEncoding |
This is the encoding for floating point numbers in the payload, and is a synthesized property derived from the Encoding field. If:
|
Format |
Format name of message data, this can be an MQ-defined format name or an application-defined format name. |
GroupId |
Group identifier |
IntegerEncoding |
This is the encoding for integers in the payload, and is a synthesized property that is derived from the Encoding field. If:
|
LastMsgInGroup |
If:
|
MsgId |
Message identifier. |
MsgInGroup |
If:
|
MsgSeqNumber |
Message sequence number |
MessageType |
Message type in the form of a decimal number, unless:
|
NegativeActionNotification |
This is a synthesized property, derived from the Report field. The receiving application should generate a negative-action notification (NAN) report.
|
Persistence |
The persistence of the message. If:
|
PositiveActionNotification |
This is a synthesized property derived from the Report field. The receiving application should generate a positive-action notification (PAN) report. If:
|
PutApplName |
Name of application that put the message. |
PutApplType |
Type of application that put the messag.e |
PutDate |
Date when message was put. |
PutTime |
Time when message was put. |
ReplyCorrelationId |
A synthesized property, derived from the Report field. Denotes what to use as the correlation ID of the report message.
|
ReplyMsgId |
A synthesized property, derived from the Report field. Denotes what to use as the message ID of the report message.
|
ReplyToQ |
Name of reply queue. |
ReplyToQMgr |
Name of the reply queue manager. |
Report |
Report options from the message. This is a bitmap of MQRO * flags. |
UserIdentifier |
User identifier. |
Property name |
Description |
---|---|
correlation |
Correlation ID from the message |
destination |
The name of the destination from the message |
encoding |
The encoding name of the message |
messageid |
The message ID from the message |
mode |
Delivery mode of the message. Values:
|
priority |
The message priority |
redelivered |
The redelivery status from the message |
replyto |
The replyto name from the message |
timestamp |
The message timestamp |
ttl |
A time-to-live value from the message that indicates how long a message exists |
type |
The message type |
Contains the ID of the most recent message sent or received.
MQ – MQ does not verify that the @@msgid consists of printable characters. Application programs should not rely on @@msgid being in the current server character set, and should only use @@msgid as a selector for subsequent messages. If @@msgid is returning to the application, it should be converted to a varbinary datatype.
Functions that set the variable are:
JMS – msgsend, msgpublish, msgrecv, msgconsume.
MQ – msgsend, msgrecv.
Contains message properties information from the most recent message received. This variable’s format is in XML. For details about this format, see “<msgheader> and <msgproperties> documents”.
JMS – the @@msgproperties are the user properties from the message.
MQ – if:
The message contains one or more MQRF headers, the name-value pairs in the MQRF headers and inserted into @@msgproperties.
Since the name-value pairs in the MQRF header can have non-unique names, the names are made unique by appending a “_ddd”, where ddd is an integer extension for uniqueness.
For instance, a MQRF header with these topics:
MQPSTopic */baseball MQPSTopic */baseball/world series MQPSTopic */sports
Results in these properties in @@msgproperties:
MQPSTopic */baseball MQPSTopic_1 */baseball/world series MPQSTopic_2 */sports
Functions that set the variable are:
JMS – msgrecv, msgconsume.
MQ – msgrecv.
The list below lists RFH name-value pairs that are extracted from the RF header if they are present.
MQPSCommand |
MQPSPubOpts |
MQPSStreamName |
MQPSCompCode |
MQPSPubTime |
MQPSStringData |
MQPSCorrelId |
MQPSQMgrName |
MQPSSubIdentity |
MQPSDelOpts |
MQPSQName |
MQPSSubName |
MQPSErrorId |
MQPSReason |
MQPSSubUserData |
MQPSErrorPos |
MQPSReasonText |
MQPSSubUserData |
MQPSIntData |
MQPSRegOpts |
MQPSTopic |
MQPSParmId |
MQPSSeqNum |
MQPSUserId |
Unrecognized names are ignored. If the value is quoted (“) in the RF header, the surrounding quotes are removed. In a quoted value, if there are escaped quotes (“”) within the value, doubled quotes are replaced by a single quote.
MQ only – contains the ReplyToQmgr name of the last message read.
Contains the name (provider_url, queue_name, topic_name, user_name) of the topic or queue name used to receive the next message. Can be a permanent or temporary destination.
Functions that set the variable are:
JMS – msgsend, msgpublish.
MQ – msgsend.
TIBCO JMS only – contains the schema of the message or a null value. Contains the value of the Adaptive Server property ase_message_body_schema. For more information, see the description of the schema option in msgsend and msgpublish.
Functions that set the variable are: msgsend, msgpublish.
Contains either the integer error code of the service provider exception, or zero, if the last operation did not raise an exception.
Functions that set the variable are: msgsend, msgpublish, msgrecv, msgconsume.
Contains either the error message of the service provider exception, or zero, if the last msgsend, msgpublish, msgrecv, or msgconsume raised an exception, or an empty string.
MQ – contains provider error message of last messaging operation. The MQ client libraries do not provide localized error messages, so you see an error message such as:
MQ API call failed with reason code '%s' (%d)
The “%s
” is
substituted with the MQ mnemonic for the MQ reason code.
The “%d
” is
substituted with the decimal MQ reason code.
Functions that set the variable are:
JMS – msgsend, msgpublish, msgrecv, msgconsume.
MQ – msgsend, msgrecv.
Contains the timestamp included in the message last sent.
Functions that set the variable are: msgsend, msgpublish.
MQ only – shows request/reply messaging using both @@msgreplytoinfo and @@msgcorrelation:
Session 1 (requester) |
Session 2 (receiver) |
---|---|
|
|
|
|
|
In this example:
Session 1 sends the request message to Q100, and expects the reply messsage on Q200. It sets the correlation to 0x123456.
Session 2 reads a message from Q100, sends a reply message to Q200, and specifies the correlation to 0x123456. The reply queue is obtained from the message that was just read.
Session 1 reads the reply message from Q200, wanting only message with correlation 0x123456.
These global variables are char datatypes, of length 16384.
You can remove trailing blanks using rtrim.
@@msgreplytoinfo contains reply destination information from the message header. It is formatted as an endpoint, as described in msgsend:
JMS only – the password is not included in the value of @@msgreplytoinfo. To use this destination as an argument in a subsequent msgsend or msgrecv call, add:
password=<your password>