...
Installing BAM Mediator Feature
The following installation instructions apply to WSO2 ESB version 1. Download WSO2 ESB version 4.5.x onwards.1. Download the WSO2 ESB from location: or later from http://wso2.com/products/enterprise-service-bus. Since BAM Mediator Aggregate
feature is available by default from ESB 4.6.0 onwards, you do not have to install it separately if you use a newer ESB version.
2. Since both ESB and BAM server will be run concurrently, change the port number of ESB by applying an offset. To apply an offset, navigate to <ESB_HOME>/repository/conf and open file, carbon.xml, where <ESB_HOME> is the WSO2 ESB's product distribution directory. Then change the value in xpath Server/Ports/Offset from 0 to some other integer. For example,
...
4. After starting the server, log in to ESB's management console and select menu "Configure -> Features -> Repository Management" menu. Add a new P2 repository through either through a URL or from a file system. For more information on adding a P2 feature repository, refer to section Managing the Feature Repository.
5. Once done, navigate to "Available Features" tab and select the repository added in the previous step. Click the "Find Features" button. It will take a while to list out all the available features in the feature repository. Once listed, select "BAM Mediator Aggregate" feature. If you can't see "BAM Mediator Aggregate feature", retry with one of the following suggestions:
...
6. Once the feature is selected, click "Install" link and proceed with the installation. For more information on feature installation, refer to section Installing Features.
7. Once the installation is completed, restart the WSO2 ESB server.
...
6. After "Stream Payload" and "Stream Properties" are added/edited, click the "Update" icon to reflect changes in the specific Stream Configuration. Next, click the "Add" icon to add the new Stream Property to the properties list. The "Cancel" button ignores the updated Stream Properties data.
7. After the changes are properly made to the BAM Server Profile, click on "Save" button to save all the configuration data to the secondary storage.
- After modifying the BAM Server Profile data the user can go back to BAM Server Profiles list to see the new set of existing BAM Server Profiles by clicking on the BAM Server Profile link on the top of the page.
- Similarly the user may add enough number of BAM Server Profiles and many unique Stream Configurations under a one BAM Server Profile.
...
- In the ESB product directory go to $esb_home/samples/axis2Server/src/SimpleStockQuoteService and build the backend service with Apache Ant. (You need to install Apache Ant before that.)
- Go to $esb_home/samples/axis2Server and run the Axis2 server.
For Linux,
axis2server.sh
For Windows,
axis2server.bat
- Now test whether the proxy service WSDL exists in http://localhost:9000/services/SimpleStockQuoteService?wsdl
...
- Go to ESB management console and select Main→Web Services→Add→Proxy Service from the side panel.
- Click on WSDL Based Proxy to create a new WSDL based proxy.
- Fill the form.
- Insert suitable Proxy Service Name (eg: Simple_Stock_Quote_Service_Proxy).
- Set http://localhost:9000/services/SimpleStockQuoteService?wsdl as the WSDL URI.
- Set SimpleStockQuoteService as the WSDL Service.
- Set SimpleStockQuoteServiceHttpSoap11Endpoint as the WSDL Port.
- Click Create.
- Select newly created proxy's name (here Simple_Stock_Quote_Service_Proxy) form the shown list to see the Service Dashboard of it.
...
- Go to ESB management console and select Main→Axis2 Services→List from side panel.
- Click on Simple_Stock_Quote_Service_Proxy to go to its dashboard.
- Click on Edit link under category, Specific Configuration.
- Click on Next> button.
- Select option Define Inline under category, Define In Sequence and click on its Create link.
- Click on Configuration Registry link, select [Sequence]-fault from the drop down list and click OK button.
- Click on Add Child link on the Root, select Agent→BAM from menus.
- Select BAM element from the sequence tree and go to the form appeared below.
- Select Server Profile from the available set of server profiles in the drop down list.
- Select Stream Name from the available set of stream names with the selected BAM server profile in the drop down list.
- Select Stream Version from the available set of stream versions with the selected stream name in the drop down list.
- Click Update button. You can observe the mediator XML generated for the BAM Mediator by clicking on switch to design view link. You can go back to the design view by clicking on switch to design view link.
The mediator XML is in the following format. (This is an example.)<bam xmlns="http://ws.apache.org/ns/synapse">
<serverProfile name="profile1">
<streamConfig name="stream1" version="1.0.0" ></streamConfig>
</serverProfile>
</bam>
- Add more mediators to the WSDL Proxy Service if required.
- Click Save button.
- Click Next> button.
- Click Finish button. Now the BAM mediator is added to the WSDL Proxy Service, Simple_Stock_Quote_Service_Proxy.
...
- As the ESB pack was downloaded and started, downloaded and start the WSO2 BAM without the same port offset as ESB.
- In the ESB product directory go to $esb_home/samples/axis2Client
- Build the backend service with Apache Ant (You need to install Apache Ant before that.) with the following code.
ant stockquote -Daddurl=https://localhost:8244/services/Simple_Stock_Quote_Service_Proxy -Dmode=fullquote -Dsymbol=testString
(Here addurl value should be given from the https endpoint located in Simple_Stock_Quote_Service_Proxy's service dashboard that can be navigated by going to the ESB management console Main→Web Services→List from side panel and selecting Simple_Stock_Quote_Service_Proxy. Any preferred string can be used instead of the testString for symbol )
Now BAM mediator in the proxy service, Simple_Stock_Quote_Service_Proxy should have dumped data extracted from the ESB to the key-space, EVENT_KS in the Cassandra database, with column family name same as the Stream Name. Data in the Cassandra database can be seen from the Cassandra Explorer in the BAM server.