# Topics and Subscriptions

## Topic Browser

Figure 1: Topic Browser

WSO2 Eventing provides this topic browser feature to view all the topics available in the server in a tree view. User can perform all the operations with regarding a topic via this view. Initially this tree view does not display any of the operations available for the topic. When user clicks on the topic , it will display all the operations available for that particular topic.

Operations available for a particular topic are :

- Add Subtopic
- Subscribe
- Details
- Delete

## Add Subtopic

Figure 2: Add Subtopic

Add subtopic feature provided user the ability to add a topic under the existing topic. When adding a new topic under an existing topic, user can provide the name of the new topic and set the permissions for publishing and subscribing for that topic.

Once a subtopic is added , it will direct to the Topic Browsing tree.

If user wants to add a topic directly to the root, user can click on the 'Add' sub menu item under topics menu in the left panel.

## Subscribe

Figure 3: Subscribe

All the subscriptions for a particular topic is done in this page. Once a user click on the subscribe link in topic browser, it will directed to this page. To do a subscription to that topic , user has to give some details as bellow;

- Topic

User does not need to specify the topic here , since its automatically sets up.

- Subscription Mode

This is the mode of the subscription and there are tree modes.

The default mode for the subscription is "Topic Only". With this mode , user creates the subscription only to the topic. In that mode subscribers only receive events which are published only to the that topic.

Next mode of subscription is "Topic and Immediate child". In this mode subscribers of the topic receives events published not only the specified topic but also to the immediate child 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

- Event Sink URL

This is the URL which the subscriber should provide to receive events published. When events are published to the topic, they are sent to the specified URL here.

- Expiration Time

Here user can specify the expiration time of the subscription. This is not a required parameter and if user leave it alone, subscription will never be expired.

## Topic Details

Figure 4: Topic Details

All the details related with a topic can be viewed in this page.

- Permission Details

Permissions related with the topic can be viewed here and if the user wants to change the permissions with regarding that topic, user can change the ticks on the provided check boxes and click on update permissions button.

- WS Subscription Details

All the ws subscriptions for the topic and its all children is listed here. If the user wants to unsubscribe from the topic, he can simply click on the unsubscribe link on the last column of each row.

- JMS Subscription Details

All the durable and non durable JMS subscriptions are listed here.

- Publish

This publish option provide the user the ability publish a sample XML message to a topic. Once there is a subscription for the topic, event sink URL will receive that published XML message once its click on the publish button after placing a xml message in the provided space.

## Delete

This will delete the topic from the server. To delete a topic , subscription count for that topic and its children should be zero. Otherwise it will prompt an error message specifying that there are subscriptions for the topic or its children.