Integration Server 10.3 | Built-In Services Reference Guide | JMS Folder | Summary of Elements in This Folder | pub.jms:reply
 
pub.jms:reply
WmPublic. Sends a reply message to a requesting client.
Input Parameters
JMSReplyMessage
Document A document representing the JMS message reply.
Key
Description
header
Document Optional. A document containing the header of the replying JMS message.
Key
Description
deliveryMode
String Optional. Specifies the message delivery mode for the reply message. Specify one of the following:
PERSISTENT
Default. Provide once-and-only-once delivery for the message. The message will not be lost if a JMS provider failure occurs.
NON_PERSISTENT
Provide at-most-once delivery for the message. The message has no guarantee of being saved if a JMS provider failure occurs.
priority
java.lang.Integer Optional. Specifies the message priority. The JMS standard defines priority levels from 0 to 9, with 0 as the lowest priority and 9 as the highest.
The default is 4.
timeToLive
java.lang.Long Optional. Length of time, in milliseconds, that the JMS provider system retains the reply message. The default is 0, meaning that the message does not expire.
JMSType
String Optional. Message type identifier for the message.
properties
Document Optional. A Document containing optional fields added to the message header.
Key
Description
activation
String Optional. A unique identifier that you want to assign to the message. JMS triggers use the activation value to determine if a message satisfies a join.
uuid
String Optional. A universally unique identifier for the message. Integration Server can use the uuid for exactly-once processing or for request/reply.
body
Document Optional. A Document containing the JMS message body. Integration Server supports the following formats for the JMS message body:
Key
Description
string
String Optional. Message body in the form of a String.
bytes
primitive type Optional Message body in the form of a one-dimensional byte array.
object
Object. Optional. Message body in the form of a Serializable Java object.
data
Document Optional. Message body in the form of a document (IData object).
Note:
This message format can only be used when sending a JMS message from one Integration Server to another. When the JMS message is sent, the sending Integration Server encodes the IData into a byte array. When the receiving Integration Server receives the message, it decodes the byte array into IData.
message
Object Optional. Message body in the form of a javax.jms.Message.
consumer
Object Optional. The message consumer object used to receive the request message from the JMS provider. Integration Server uses information from the consumer to create a message producer that will send the reply message.
You only need to specify a consumer when replying to a message received using pub.jms:receive.
message
Object Optional. A javax.jms.Message object that contains the request message.You can map the JMSMessage/body/message field in the request message to the pub.jms:reply message input parameter. The pub.jms:replyservice uses the request message to determine the replyTo destination.
You only need to specify a message when replying to a message received using pub.jms:receive.
Output Parameters
JMSReplyMessage
Document. A Document containing the reply message the JMS provider sent to the client. After it sends a message, the JMS provider populates some fields in the JMS reply message.
Key
Description
header
Document Conditional. A Document containing the header fields for the reply message.
JMSCorrelation ID
String Conditional. A unique identifier used to link the reply message with the initial request message.
The replying Integration Server automatically sets this value when it executes the pub.jms:reply service.
JMSDelivery Mode
java.lang.Integer Delivery mode used to send the message.
PERSISTENT indicates that the JMS provider provides once-and-only-once delivery for the message. The message will not be lost if a JMS provider failure occurs.
NON_PERSISTENT indicates that the JMS provider provides at-most-once delivery for the message. The message has no guarantee of being saved if a JMS provider failure occurs.
Note:
When sending a reply message, this value is obtained from the JMSMessage/header/deliveryMode input parameter.
JMSDestination
Object Conditional. Destination (queue or topic) to which the message was sent. The JMSReplyTo value of the request message determines the destination of the reply message.
JMSExpiration
java.lang.LongConditional. Time at which this message expires. If the message producer did not specify a time-to-live, the JMSExpiration value is zero, indicating the message does not expire.
Note:
When sending a message, this value is obtained from the JMSReplyMessage/header/timeToLive input parameter.
JMSMessageID
String Conditional. Unique identifier assigned to this message by the JMS provider.
JMSPriority
java.lang.Integer Conditional. Defines the message priority. The JMS standard defines priority levels from 0 to 9, with 0 as the lowest priority and 9 as the highest.
Note:
When sending a reply message, this value is obtained from the JMSMessage/header/priority input parameter.
JMSReplyTo
Object Conditional. Specifies the destination to which a response to this message should be sent.
JMSTimestamp
java.lang.Long Time at which the message was given to the JMS provider.
JMSType
String Conditional. Message type identifier specified by the client when sending the message.
properties
Document Conditional. A Document containing optional fields added to the message header. Integration Server may add the following properties to JMS messages it receives.
Key
Description
activation
String Conditional. A unique identifier assigned by the sending service. A JMS trigger can join together messages with the same activation.
uuid
String Conditional. A universally unique identifier for the message assigned by the sender. Integration Server can use the uuid for exactly-once processing or for request/reply.
body
Document Conditional. A Document containing the JMS message body. Integration Server supports the following formats for the JMS message body:
Key
Description
string
String Conditional. Message body in the form of a String.
bytes
primitive type Conditional Message body in the form of a one-dimensional byte array.
object
Object. Conditional. Message body in the form of a Serializable Java object.
data
Document Conditional. Message body in the form of a document (IData object).
Note:
This message format can only be used when sending a JMS message from one Integration Server to another. When the JMS message is sent, the sending Integration Server encodes the IData into a byte array. When the receiving Integration Server receives the message, it decodes the byte array into IData.
message
Object Conditional. Message body in the form of an actual javax.jms.Message.
Usage Notes
The pub.jms:reply service creates a JMS message (javax.jms.Message) based on input provided to the service or takes an existing JMS message and sends it to the JMS provider as a reply to a requesting client.
The pub.jms:reply service sends the reply message using the same connection that was used to retrieve the message.
The JMSReplyTo field in the request message is set by the sending client and indicates the destination to which the reply will be sent. The replying Integration Server automatically sets this value when it executes the pub.jms:reply service.
When executing the pub.jms:replyservice, Integration Server automatically sets the value of the JMSCorrelationID field in the JMSReplyMessage. Integration Server uses the value of the wm_tag field, uuid field, or the JMSMessageID field in the requesting JMS message to correlate the request and the response. If the wm_tag field is populated in the request message, Integration Serveruses the wm_tag value as the JMSCorrelationID. If the request message does not specify a wm_tag value and you specify the uuid when sending the request, the replying Integration Serverwill use the uuid as the JMSCorrelationID of the reply message. If the request message does not specify a wm_tag value and you do not specify a uuid, the replying Integration Serveruses the JMSMessageID of the request message as the JMSCorrelationID of the reply message.
When replying to a message received using pub.jms:receive, you need to specify the input parameters consumer and message.
If a transaction has not yet been started, the transaction manager starts a transaction context for an implicit transaction when Integration Server executes a pub.jms:reply service that uses a transacted JMS connection alias. A JMS connection alias is considered to be transacted when it has a transaction type of XA TRANSACTION or LOCAL TRANSACTION.
If you want more control over the actual javax.jms.Message that Integration Server sends to the JMS provider, you can create a Java service that calls the com.wm.app.b2b.server.jms.producer.ProducerFacade class, which will create a javax.jms.Message. See:
*com.wm.app.b2b.server.jms.producer.ProducerFacade.createBytesMessage(String)
*com.wm.app.b2b.server.jms.producer.ProducerFacade.createMapMessage(String)
*com.wm.app.b2b.server.jms.producer.ProducerFacade.createObjectMessage(String)
*com.wm.app.b2b.server.jms.producer.ProducerFacade.createStreamMessage(String)
*com.wm.app.b2b.server.jms.producer.ProducerFacade.createTextMessage(String)
The Java service calling this API must return an Object of type javax.jms.Message, which can then be mapped to the JMSMessage/body/message input parameter of the pub.jms:reply service.
When creating the javax.jms.Message with the com.wm.app.b2b.server.jms.producer.ProducerFacade, you can use the javax.jms.Message setter methods to set the values of the message headers and properties directly. You can also set the value of message headers and properties using the input parameters of the pub.jms:replyservice that you use to send the message. If you set the message headers and properties both ways, the values provided to the pub.jms:replyservice take precedence.
Software AG recommends that you use a pub.jms:reply service to create and send the JMS message. This may provide better performance on average. However, if you want to send a StreamMessage or a MapMessage, you need to use the appropriate com.wm.app.b2b.server.jms.producer.ProducerFacade API.
When using Universal Messaging as the JMS provider, the JMS client can use synchronous or asynchronous publishing. To ensure delivery of a persistent JMS message (deliveryMode is set to PERSISTENT), Integration Server always uses synchronous publishing to send a persistent JMS message to Universal Messaging.
Message priority is not supported when Universal Messaging is the JMS provider. Any value specified in the priority field will be ignored.
See Also
pub.jms:createConsumer
pub.jms:receive