The goal of this guide is to provide guidelines to be followed in order to get familiar with WSO2 Message Broker and the procedure of using the features provided by the product.
This gives a brief introduction of how message broker can be used in publishing and receiving messages.
WSO2 Message Broker is basically consist of two major features. They are:
This feature of the WSO2 Message Broker provides the facility for users to route messages to the required users. If we are explaining deeply, there is a concept called 'Topic' and message routing is done on the base of that topic. When a particular user want to publish a message to a particular sector , he creates a topic with a name related to the messages that he is going to pulish. As an example, if a particular user want to publish messages related with sports news, he can create a topic with the name 'SportsNews' and publish the messages to that topic.
When another particular user is interested on any topic in the topic tree, he can subscribe to that topic and receive messages which are published to that topic by the publisher. As in the above example, when a particular user is interested on sports, he can subscribed to the topic 'SportsNews' and get messages published to that topic.

This feature of the WSO2 Message Broker provides the facility for users to store messages in an intermediate location which were sent by some one else to the user and access them on demand. In order to have this feature, WSO2 Message Broker uses a Message Queue and all the operations are carried out on that message queue. This message box feature is like the email box we have, more clearly , any one can send messages to Queue and only the owner of the queue can consume the messages stored in that queue.

In WSO2 Message Broker , Pub/Sub feature is one of the two major features. Inorder to use this feature , it is needed to create a Topic and subscribe to it.


Once you click on a topic in the topic tree , it will display all the available operations on a topic. Once you click on the 'Help' link on that page you will find the information on all the operations available on the topic
If you click on details link , you will find following page.


Once you click on 'Subscribe' link on the above page, you will be directed to Add subscriptions page.

You can create a subscription to the topic by provide the information on subscription
The default mode for the subscription is "Topic Only". With this mode , user creates the subscription only to the topic. In this mode subscribers only receive events which are published only to the that topic.
Next mode of subscription is "Immediate children". In this mode subscribers of the topic receives events published to the immediate children of that topic.
Last mode of subscription is "Topic and Children". In this mode subscribers of the specified topic will receive events published to the specified topic and all its children
Note : You can create a simple axis2service and use it's URL as the EventSinkURL . Inorder to create an axis2service ,
(This ant task will create a simple axis2service 'EventSinkService' and deploy it in the location : /wso2mb-1.0.2/repository/deployment/server/axis2services/ )
Now you can create a subscription by providing the Event Sink URL : https://localhost:9443/services/EventSinkService/getOMElement
Click on the button 'Subscribe' and it will create the subscription and list it in the subscription table of that topic in topic details page.

Then check the command line and you will be able to see the XML Message that you typed in the provided space.
Message box is a simple queue where user can store, retrieve and delete messages. Message box provides the Simple Queue Service(SQS) operations. In SQS, When a message is received by an user, that message is unaccessible for a specified time duration, and this message is not visible for other users till that specified time duration is over. If the message received user did not delete the message in that time duration, the message is visible for other users. This time duration is named as visibility timeout.
For more information regarding SQS, please refer links provided at references.

To view message box content, click on message box name
To delete message box, click on delete icon at the right hand side. A successful message will be prompted.

View messages which are retrievable under content of message box.
Add messages to message box. These messages are added under retrievable messages of message box.

Retrieve messages from message box. User can set visibility timeout value for retrieving messages and the number of messages to retrieve. Retrieved messages are added under retrieved messages.

View retrieved messages from message box. These messages are displayed under the table retrieved messages from message box. If user did not delete these messages before visibility timeout, those messages will be available to retrieve for other users. If user tried to retrieved messages with low visibility timeout value, they will be retrieved and will be visible to retrieve again.

Message box can be shared with other users for five operations such as Send, Receive, Delete, ChangeVisibility and GetQueueAttributes. Those permissions allowed users can access queue for above operations. Permission label is defined for each allowed permission set. This label is used to delete allowed permissions.