This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Sending and Receiving Messages Using Topics

This sample demonstrates how to create a topic, and to subscribe to/publish messages in it.

About the sample

The <MB_HOME>/Samples/JMSQueueClient/src/org/sample/jms directory has the following classes.

Prerequisites

See Prerequisites to Run the MB Samples for a list of prerequisites.

Building the sample

To run this sample, run the ant command from <MB_HOME>/Samples/JMSTopicClient directory.

Analyzing the output

Once you run this sample, you will see the following log in your console.

[java] Got message from topic subscriber = Test Message

To view the topic in the MB Management Console, log into the MB Management Console. Then click  Browse  under  Topics  in the Main  tab. You will see a topic named MYTopic automatically created.