Products | Versions |
---|---|
TIBCO ActiveMatrix BusinessWorks | - |
Not Applicable | - |
1). User wants to use JMSQueueRequester activity.
Abstract
= = = = =
2). Users can create their own requester logic using a Send JMS message (to send requests) and use a Get JMS message activity (to a receive reply). This approach uses static destinations for reply and by making use of a selector. The Get JMS activity picks only messages among all available messages which evaluates the selector.
- "This ID can be used to link messages, such as linking a response message to a request message. Entering a value in this field is optional".
Confusion may arise because of the word "link" above. We expect there is or has to be an internal mechanism in a request reply activity which filters messages based on JMSCorrleationID specified in a request and response message. JMS request reply activity cannot have provision of filters based on JMSCorrleationID or any other header / property due to internal product design. If the selector option is made available it can have an inverse impact. We suggest using a combination of Send JMS message and Get /Wait JMS message activity which provides selector options.
Note that JMSCorrleationID is not for filtering out messages but is for correlating messages when tracking the request and response. When you have parallel execution of multiple process instances, how should you track the request and response messages? Here is where JMSCorrleationID comes into the picture. You can set JMSCorrleationID for the request message. When the request message is received on the receiver side, map JMSCorrleationID from the receiver activity to the Reply To JMS message activity's JMSCorrleationID field and send a response. The requester can fetch that JMSCorrleationID again for tracking. When logging this work flow for more than one running instance, JMSCorrleationID will help track the request response flow.
It is not mandatory that only the JMSCorrleationID should be used for filtering in activities which support selector options. You can create your own JMS message properties and apply selectors on them. In other words, JMSCorrleationID is not for filtering out the messages but is added as a header which you can use to correlate the request and response message.
BW and EMS supports the JMS specification, therefore while creating a JMS message, the JMSCorrleationID header has to be there and cannot be removed that from the input tab of request reply activity. Since that field is optional, you can either use it or keep it blank.
In short, JMSCorrleationID is not for filtering out messages but is for correlating messages when tracking of the request and response, just like any other JMS header property (optional) available as per the JMS Specification. Its depends on the client's implementation whether to use it for correlation or not. In BW JMS Request/Reply activity, we are not utilizing the request response correlation using the selector + JMSCorrleationID, because it can have an adverse impact.
Points to be noted:
1). If you want to achieve request-response use case with JMS request reply activity, use it with its default nature, i.e., with temporary destinations. BW will ensure to deliver the correct response to the requester.
2). If you want to use static queues in a request reply activity, ensure that the queue be unique across multiple process instances.
3). While receiving a response, if you want to filter out the messages based on some value (it could be JMSCorrleationID or JMS properties), use a combination of JMS queue sender and wait / get JMS queue messages and make use of the selector option.
See the attached (Filename: requesterApplication.zip) for reference.