Sending a JMS Message to a Queue and Waiting for a Response
After sending a JMS message, the JMSSignalIn activity gets the response and filters it as required.
Procedure
Result
When running both applications in the same TIBCO Business Studio for BusinessWorks instance, the Console view displays the information similar to the following:
14:46:23.347 [bwThread:In-Memory STWorkProcessor-2] INFO c.t.b.p.g.L.t.b.s.p.j.Q.Log - Received a Queue Message. Request = This is a test request. JMSMessageID = ID:EMS-SERVER.25FC52F2890A57:6. JobId [bw0a101], ProcessInstanceId [bw0a101], Activity [Log], Process [tibco.bw.sample.palette.jms.queuereceiver.QueueReceiver], Module [tibco.bw.sample.palette.jms.QueueReceiver:1.0.0.qualifier], Application [tibco.bw.sample.palette.jms.QueueReceiver.application:1.0].
14:46:23.365 [bwThread:In-Memory STWorkProcessor-3] INFO c.t.b.p.g.L.t.b.s.p.j.S.Log1 - Received the response. Response = This is a test response. JMSCorrelationID = ID:EMS-SERVER.25FC52F2890A57:6. JobId [bw0a100], ProcessInstanceId [bw0a100], Activity [Log1], Process [tibco.bw.sample.palette.jms.SenderAndSignalIn.QueueSenderWait], Module [tibco.bw.sample.palette.jms.SenderAndSignalIn:1.0.0.qualifier], Application [tibco.bw.sample.palette.jms.SenderAndSignalIn.application:1.0].
The output.log output file at C:\tmp\SenderAndSignalIn shows that the message has been sent to the queue and the response has been received using Signal-In activity.
Understanding the Configuration
- The JMS Send Message activity sends a Queue message. It also sets a static reply destination in the advanced tab. The responder uses this reply destination to reply the message.
- The JMS SignalIn activity uses Conversation mechanism wherein a conversation is initiated by the Correlation Key, which is JMSMessageID sent by the JMS Queue Sender activity. Conversation "Join" uses JMSCorrelationID to filter the correct response with the correct job.