In this post i’ll describe how we can configure WSO2 Message Broker and WSO2 ESB together. (Note : Here I'm using ESB_HOME as WSO2 ESB installation directory path and MB_HOME as WSO2 MB installation directory path.)
In this first instance we are going to get the WSO2 ESB and MB to work together.
Once you have downloaded and unzipped
Open carbon.xml in MB_HOME/repository/conf directroy and set the offset value to 1,then
Start WSO2 Message Broker.
Open event-broker.xml file in ESB_HOME/repository/conf directory and change deliveryManager type "remote".Then uncomment remoteMessageBroker details & set service port to 9444 & qpidPortto 5673 as below
<deliveryManager name="deliveryManager"
class="org.wso2.carbon.event.core.internal.delivery.jms.QpidJMSDeliveryManagerFactory"
type="remote">
<remoteMessageBroker>
<hostName>localhost</hostName>
<servicePort>9444</servicePort>
<webContext>/</webContext>
<userName>admin</userName>
<password>admin</password>
<qpidPort>5673</qpidPort>
<clientID>clientID</clientID>
<virtualHostName>carbon</virtualHostName>
</remoteMessageBroker>
</deliveryManager>
After Start WSO2 ESB
Then create topic name test in WSO2 ESB & subscribe. You can create a subscription to the topic by providing the information on subscription as below
1.Topic
2.Subscription Mode
The default mode for the subscription is "Topic Only". With this mode , user creates the subscription only to the topic
3.Event Sink URL
you can create a subscription by providing the Event Sink URL : https://localhost:9443/services/EventSinkService/getOMElement
(Note : You can create a simple axis2service and use it's URL as the EventSinkURL . Inorder to create an axis2service ,
Browse the location : /wso2mb-1.0.3/samples/services/EventSinkService
Type the command : ant)
Now you can create a subscription by providing the Event Sink URL : https://localhost:9443/services/EventSinkService/getOMElement
Create a topic & message box with same name in WSO2 MB & subscribe as sqs://admin/topic_name.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.
After that we Publish xml message in WSO2 ESB it will successfully prompted to WSO2 MB
Using the message box in WSO2 MB User can view the content of the message box by going through link in list view.
In this first instance we are going to get the WSO2 ESB and MB to work together.
Once you have downloaded and unzipped
Open carbon.xml in MB_HOME/repository/conf directroy and set the offset value to 1,then
Start WSO2 Message Broker.
Open event-broker.xml file in ESB_HOME/repository/conf directory and change deliveryManager type "remote".Then uncomment remoteMessageBroker details & set service port to 9444 & qpidPortto 5673 as below
<deliveryManager name="deliveryManager"
class="org.wso2.carbon.event.core.internal.delivery.jms.QpidJMSDeliveryManagerFactory"
type="remote">
<remoteMessageBroker>
<hostName>localhost</hostName>
<servicePort>9444</servicePort>
<webContext>/</webContext>
<userName>admin</userName>
<password>admin</password>
<qpidPort>5673</qpidPort>
<clientID>clientID</clientID>
<virtualHostName>carbon</virtualHostName>
</remoteMessageBroker>
</deliveryManager>
After Start WSO2 ESB
Then create topic name test in WSO2 ESB & subscribe. You can create a subscription to the topic by providing the information on subscription as below
1.Topic
2.Subscription Mode
The default mode for the subscription is "Topic Only". With this mode , user creates the subscription only to the topic
3.Event Sink URL
you can create a subscription by providing the Event Sink URL : https://localhost:9443/services/EventSinkService/getOMElement
(Note : You can create a simple axis2service and use it's URL as the EventSinkURL . Inorder to create an axis2service ,
Browse the location : /wso2mb-1.0.3/samples/services/EventSinkService
Type the command : ant)
Now you can create a subscription by providing the Event Sink URL : https://localhost:9443/services/EventSinkService/getOMElement
Create a topic & message box with same name in WSO2 MB & subscribe as sqs://admin/topic_name.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.
After that we Publish xml message in WSO2 ESB it will successfully prompted to WSO2 MB
Using the message box in WSO2 MB User can view the content of the message box by going through link in list view.