Sun Java System Message Queue 4.2 Developer's Guide for Java Clients

Message Properties

A message property consists of a name string and an associated value, which must be either a string or one of the standard Java primitive data types (int, byte, short, long, float, double, or boolean). The Message interface provides methods for setting properties of each type (see Table 2–6). There is also a setObjectProperty method that accepts a primitive value in objectified form, as a Java object of class Integer, Byte, Short, Long, Float , Double, Boolean, or String . The clearProperties method deletes all properties associated with a message; the message header and body are not affected.

Table 2–6 Message Property Specification Methods

Name 

Description 

setIntProperty

Set integer property 

setByteProperty

Set byte property 

setShortProperty

Set short integer property 

setLongProperty

Set long integer property 

setFloatProperty

Set floating-point property 

setDoubleProperty

Set double-precision property 

setBooleanProperty

Set boolean property 

setStringProperty

Set string property 

setObjectProperty

Set property from object 

clearProperties

Clear properties 

The JMS specification defines certain standard properties, listed in Table 2–7 . By convention, the names of all such standard properties begin with the letters JMSX; names of this form are reserved and must not be used by a client application for its own custom message properties. Similarly, property names beginning with JMS_SUN are reserved for provider-specific properties defined by Message Queue itself; these are discussed in Chapter 3, Message Queue Clients: Design and Features

Table 2–7 Standard JMS Message Properties

Name 

Description 

JMSXUserID

Identity of user sending message 

JMSXAppID

Identity of application sending message 

JMSXDeliveryCount

Number of delivery attempts 

JMSXGroupID

Identity of message group to which this message belongs 

JMSXGroupSeq

Sequence number within message group 

JMSXProducerTXID

Identifier of transaction within which message was produced 

JMSXConsumerTXID

Identifier of transaction within which message was consumed 

JMSXRcvTimestamp

Time message delivered to consumer 

JMSXState

Message state (waiting, ready, expired, or retained)