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.

Prerequisites

TIBCO Enterprise Message Service must be running.

Procedure

  1. In the samples directory, select palette > jms > TopicDurableSubscriber and double-click tibco.bw.sample.palette.jms.TopicDurableSubscriber. For more information, see Accessing Samples.
  2. In the Project Explorer view, expand the tibco.bw.sample.palette.jms.TopicDurableSubscriber project.
  3. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  4. Verify your TIBCO Enterprise Message Service connection.
    1. Fully expand the Resources directory.
    2. Double-click JMSConnectionResource.jmsConnResource.
    3. In the Basic Configuration dialog box, click the Test Connection button to verify the connection.
  5. Fully expand the Processes directory and double-click TopicPublisher.bwp.
  6. Click Run > Debug Configurations.
  7. At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  8. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.palette.jms.TopicDurableSubscriber.application.
  9. Click Debug.
    The sample runs in Debug mode.
  10. Click the Terminate icon to stop the process.

Result

On Windows: The TopicDurableSubscriber.log output file at C:\tmp\TopicDurableSubscriber shows that the message is published to a topic and a topic subscriber has received the message from the topic.

On UNIX: /tmp/TopicDurableSubscriber

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.