Sending a JMS Message and Receiving a Durable Response
The JMS Receiver Event Source activity can be configured as a Durable Subscriber. If the subscriber is offline, the subscriber's messages are stored by the JMS server and delivered when the subscriber is online.
TIBCO Enterprise Message Service must be running.
- Procedure
- In the samples directory, select and double-click tibco.bw.sample.palette.jms.TopicDurableSubscriber. For more information, see Accessing Samples.
- In the Project Explorer view, expand the tibco.bw.sample.palette.jms.TopicDurableSubscriber 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 TopicPublisher.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.TopicDurableSubscriber.application.
- Click
Debug.
The sample runs in Debug mode.
- Click the
Terminate
icon to stop the process.
The Console displays a message similar to the following:
15:46:34.903 [PVM:In-Memory STWorkProcessor:1] INFO c.t.b.p.g.L.t.b.p.j.D.Log - Message=Publishing a Topic Message, MessageId=
15:46:35.043 [PVM:In-Memory STWorkProcessor:2] INFO c.t.b.p.g.L.t.b.p.j.D.Log - Message=Received a Topic Message. Message = This is a test Topic Message, MessageId=.
Understanding the Configuration
The JMS Send Message activity sends a message to the topic.sample topic. The JMS Receive Message activity subscribes to the topic.sample topic. Additionally, the JMS Receive Message activity is configured as durable, allowing messages to be received later if the receiver is offline.