Chapter 2 Working With Channels and Destinations : Using JMS Header Properties in Incoming and Outgoing Messages

Using JMS Header Properties in Incoming and Outgoing Messages
Information in this section assumes you are familiar with JMS and its header properties. Consult your JMS provider documentation for information. This section explains only how BusinessEvents supports use of these properties.
Setting Certain Header Properties in Destinations
The JMS destination Configuration tab allow you to configure the following three header properties:
DeliveryMode (JMSDeliveryMode)
Priority (JMSPriority)
TTL (JMSExpiration)
Setting Header Properties in Events
You can configure events created from JMS messages to contain JMS header properties. Similarly, you can use event properties to set JMS header properties in outgoing messages. To use the JMS header properties, you configure events to have properties that match the JMS header fields. You must use the names as shown in Table 7, JMS Header Field Names. You only have to configure event properties for those fields that you want to use. Incoming JMS message header properties will then populate the corresponding BusinessEvents event properties.
Similarly outgoing JMS message header properties will be populated by the corresponding BusinessEvents event properties.
Note that the JMSMessageID and JMSTimeStamp properties are generated when the message is sent. You can’t set these properties manually.
Use of the JMSReplyTo property in BusinessEvents is limited, as explained below.
See Table 7, JMS Header Field Names for details on all properties.
Internal Use of JMSReplyTo Header Property for Request-Response Scenario
BusinessEvents cannot act as a client in a JMS request-response scenario because BusinessEvents currently cannot dynamically create a destination to listen for JMS messages.
When an incoming JMS message is mapped to a BusinessEvents event, the JMSReplyTo property of the event (if it exists) is set to null.
BusinessEvents does, however, use the value of the JMSReplyTo JMS header property internally when it sends a response to a JMS request, as explained below.
How BusinessEvents Uses JMSReplyTo Property to Reply to Messages
In a request-response scenario, you use the Event.ReplyEvent() function to send a reply to an incoming message. This function takes two arguments:
The request event, which holds details about the incoming request message. In this case, the incoming message is the JMS message which you map to an event.
You must create these events as appropriate for the specific request-response scenario, and use them in your rules. You must also associate them with BusinessEvents destination resources, in the usual way.
Internally, BusinessEvents uses the JMSReplyTo property from the request (incoming) message to set the destination (JMSDestination) in the response (outgoing) message. (That value also overrides any value set in the BusinessEvents destination resource that is associated with the reply event.)
JMS Header Field Names
The table below shows the names you must use to define event properties corresponding to JMS header field names, as well as some details about the purpose of each property. The property names are not case sensitive.
See How BusinessEvents Uses JMSReplyTo Property to Reply to Messages for details on use of this property in response messages.
The delivery mode specified by the sender. This property instructs the server concerning persistent storage for the message. Value can be:
2—interpreted as PERSISTENT (default).
1—interpreted as NON-PERSISTENT.
22—interpreted as RELIABLE. This value is an extension to the standard used in TIBCO Enterprise Message Service.
The length of time that message will live (in milliseconds) before expiration. If set to 0, the message does not expire.
The message priority, a numerical value between 0 and 9. Larger numbers represent higher priority.
The time when the message was handed off to a provider to be sent. The message may be sent later than this timestamp value.
A correlation ID that can be used to link messages. For example, you can link a response message to a request message. Optional.
See Internal Use of JMSReplyTo Header Property for Request-Response Scenario for details about use of this property in BusinessEvents.
If this field is set, it is possible that the message was delivered to the client earlier, but not acknowledged at that time.