This documentation is for WSO2 MB version 3.1.0. Click this link to go to the latest version's home page.

Skip to end of metadata
Go to start of metadata

Several sample scenarios of the WSO2 Message Broker are explained in this section. These samples can be used as references to build your own application using various features of the Message Broker. The samples shipped with WSO2 Message Broker are stored in the <CARBON_HOME>/samples directory.

See the following topics for details: 

About MB samples

The MB samples use several sample clients. For example, to illustrate a scenario where messages are published and received by subscribers, we need two clients; one for publishing messages to MB and another for subscribing and receiving messages.

These clients are defined via classes that are saved in the separate folders dedicated for each sample in the <MB_HOME>/samples directory. A sample may have more than one client to perform different actions. Since there are interdependencies between different clients used in a sample, the classes defining them need to be bound to each other. To achieve this, the sample folder where the classes of the clients are stored, also contains a class named Main.class, which defines the method for calling the other classes in the same directory.

For example, consider the "JMSQueueClient" sample, which you will find in the <MB_HOME>/samples directory. If you see the contents of the JMSQueueClient sample folder, you will find the following classes (inside the JMSQueueClient/target/classes/org/sample/jms folder):

  • SampleQueueReceiver.class: The class file defining the JMS client for receiving messages from the queue.
  • SampleQueueSender.class: The class file defining the JMS client for sending messages to the queue.
  • Main.class: The main class that binds the two client classes.

Setting up and running the samples

See the following topics for instructions on how to setup and run the samples in WSO2 MB: 

  • No labels