Chapter 4: SQL Reference  <msgheader> and <msgproperties> documents

Chapter 4: SQL Reference

Messaging-related global variables

These global variables provide application programs with access to message information from the most recent message sent or received. They are discussed in Chapter 4, “SQL Reference.”

@@msgcorrelation

Contains correlation from last message sent or read.

@@msgcorrelation contains the correlationId from the the most recent message sent or received.

@@msgheader

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.

Table 4-1: @@msgheader fields and descriptions

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:

  • persistent

  • nonpersistent

priority

The message priority

redelivered

The redelivery status from the message

replyto

The replyto name from the message

timestamp

The message timestamp

ttl

The expiry from the message that indicates how long a message exists

type

The message type

@@msgid

Contains the ID of the most recent message sent or received.

Functions that set the variable are: msgsend, msgpublish, msgrecv, msgconsume.

@@msgproperties

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”.

The @@msgproperties are the user properties from the message.

Functions that set the variable are: msgrecv, msgconsume

@@msgreplytoinfo

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 is: msgsend

@@msgschema

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.

@@msgstatus

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.

@@msgstatusinfo

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.

Functions that set the variable are: msgsend, msgrecv.

@@msgtimestamp

Contains the timestamp included in the message last sent.

Functions that set the variable are: msgsend, msgpublish.

Usage





Copyright © 2005. Sybase Inc. All rights reserved. <msgheader> and <msgproperties> documents

View this book as PDF