Receiving a JMS Message from a Queue and Responding to the Message
The JMS Queue Receiver and Reply to JMS Message activities can be configured to receive and respond to JMS messages.
TIBCO Enterprise Message Service must be running.
- Procedure
- In the samples directory, select and double-click tibco.bw.sample.palette.jms.QueueReceiver. For more information, see Accessing Samples.
- In the Project Explorer view, expand the tibco.bw.sample.palette.jms.QueueReceiver project.
- Verify your TIBCO Enterprise Message Service connection.
- Fully expand the Resources directory.
- Double-click JMSConnectionResource.jmsConnResource.
- In the Basic Configuration dialog, click the Test Connection button to verify the connection.
- Fully expand the Processes directory and double-click QueueReceiver.bwp.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco.bw.sample.palette.jms.QueueReceiver.application.
- Trigger the application by sending a request. You can use the tibco.bw.sample.palette.jms.SenderAndSignalIn sample to send the request. For more information, see Sending a JMS Message to a Queue and Waiting for a Response). The applications can run in the same or separate TIBCO Business Studio™ for BusinessWorks™ instance. If you run the applications in the same instance, load the application before clicking Debug.
- Click
Debug.
This runs the sample in Debug mode.
- Click the
Terminate
icon to stop the process.
When both applications are running in the same TIBCO Business Studio for BusinessWorks instance, information similar to the following is displayed in the console:
14:32:46.402 [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.25FC52F2890A46:6. JobId [bw0a101], ProcessInstanceId [bw0a101], Activity [Log], Process [tibco.bw.sample.palette.jms.queuereceiver.Process], Module [tibco.bw.sample.palette.jms.QueueReceiver:1.0.0.qualifier], Application [tibco.bw.sample.palette.jms.QueueReceiver.application:1.0].
14:32:46.419 [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.25FC52F2890A46:6. JobId [bw0a100], ProcessInstanceId [bw0a100], Activity [Log1], Process [tibco.bw.sample.palette.jms.senderandsignalin.Process], Module [tibco.bw.sample.palette.jms.SenderAndSignalIn:1.0.0.qualifier], Application [tibco.bw.sample.palette.jms.SenderAndSignalIn.application:1.0].
Understanding the Configuration
The sample uses the JMS Queue Receiver activity to get messages off the queue. The Reply to JMS Message activity responds to the incoming JMS message and automatically uses the JMSReplyTo header to get the reply destination.