# @jc:jms-headers Annotation

In a JMS control, set and retrieves values for the JMS message headers.

Note: The @jc:jms-headers annotation appears in JMS controls with the .jcx extension. JMS controls with the .ctrl extension, which were created in a previous version of WebLogic Workshop, use the @jws:jms-header annotation. Controls with the .ctrl extension continue to be supported in WebLogic Workshop.

##

## Syntax

@jc:jms-headers

JMSCorrelationID="CorrelationID"
JMSDeliveryMode="DeliveryMode"
JMSExpiration="Expiration"
JMSMessageID="MessageID"
JMSPriority="Priority"
JMSRedelivered="Redelivered"
JMSTimestamp="Timestamp"
JMSType="Type"

## Attributes

JMSCorrelationID

Read/write. You can set this header to the conversation ID of the listening service.

JMSDeliveryMode

Read-only. Contains the delivery mode specified when the message was sent.

JMSExpiration

Read-only. Calculated as the sum of the message-time-to-live value when the message was sent plus the current GMT.

JMSMessageID

Read-only. Contains a unique identifier for the message.

JMSPriority

Read-only. Contains the message's priority.

JMSRedelivered

Read-only. Indicates that the message may have been delivered but not acknowledged in the past.

JMSTimestamp

Read-only. Contains the time that the message was handed off by the provider to be sent.

JMSType

Read/write. Can be set to an arbitrary value to distinguish the type of message the sender is sending.

## Remarks

The following rules apply to this annotation's use:

- Only one @jc:jms-headers annotation may appear within a single Javadoc comment block.
- Optionally may appear in front of a method in a JCX file defining a JMS control.
- Optionally may appear in front of a callback in a JCX file defining a JMS control.

On a method of a JMS control, sets these headers on the outgoing message. Only JMSCorrelationID and JMSType can be set; the others are read-only.

On a callback of a JMS control, retrieves these headers from the incoming message and passes them as parameters to the callback.

## Example

The example below demonstrates use of the @jc:jms-headers annotation in the callback that receives a message on the JMS control. The header values are retrieved from the message by the control and passed in to the calback:

    /**
    * @jc:jms-headers
    *   JMSCorrelationID="{CorrelationID}"
    *   JMSDeliveryMode="{DeliveryMode}"
    *   JMSExpiration="{Expiration}"
    *   JMSMessageID="{MessageID}"
    *   JMSPriority="{Priority}"
    *   JMSRedelivered="{Redelivered}"
    *   JMSTimestamp="{Timestamp}"
    *   JMSType="{Type}"
    **/
    public void receiveUpdate(
                              // Message body (XMLBean type)
                              AccountTransaction transaction,
                              // Headers
                              String CorrelationID,
                              String DeliveryMode,
                              String Expiration,
                              String MessageID,
                              String Priority,
                              String Redelivered,
                              long Timestamp,
                              String Type
                              );

Related Topics

JMS Control

Specifying Message Headers and Properties

@jc:jms Annotation

@jc:jms-property Annotation