As we are running both AS and BAM server concurrently we should change the port number of AS by applying an offset. In order to apply an offset, in the AS product directory go to $as_home/repository/conf and open file, carbon.xml . Then change the value in xpath Server/Ports/Offset from '0' to some other integer.
To start the server, on Linux
wso2server.sh
on MS Windows
wso2server.bat
Start WSO2 AS on Linux,
After starting the server, go to AS management console Configure→Features→Settings menu.
Give P2 repository link either from as a URL or from a file.
Then click 'Add'.
Go to 'Available Features' tab and select the above repository.
Click 'Find Features'.
User can see all available features. From those, select 'BAM Data Agent Service Statistics' feature and 'Statistics' feature.
Click 'Install'.
Click 'Next' and accept the license agreement.
Restart the WSO2 AS server.
Configuring Service Data Publisher
Go to AS management console and select Configure→Service Data Publishing from side panel.
Fill the form.
Tick on 'Enable Service stats ' and 'Enable Activity Service '.
Set the 'BAM URL' as the URL of the BAM server. e.g. : https://localhost:9443
Set user name and password as 'admin'.
Let the default setting and value remain for 'socket' and 'port' in 'Transport'.
Click 'Update'.
Monitoring a Sample Web Service
Go to AS management console Main→Web Services→List menu.
In web service, 'HelloService ', click 'Try this service'.
Add a sample string as 'name' and click the 'Send' button.
BAM Data Agent will send the message to the EVENT table in Cassandra database. Data in the Cassandra database can be seen by from the CLI using Cassandra Client. Using the BAM server it can execute analyzers and store results to summary tables which can be visualized by the Gadget IDE in BAM.
Sample data format for service data agent as follows.