Thursday, August 30, 2012

Monitor Stats of Carbon 3.2.x products with WSO2 BAM2

Configuring WSO2 ESB Server with Data Publishers
  1. Download WSO2 Enterprise Service Bus 4.0.2. Unzip the distribution to your preferred location. This directory will be referred as ESB_HOME.
  2. Remove the following jar from ESB_HOME/repository/components/plugins directory.

  1. Place the following set of jars into ESB_HOME/repository/components/dropins directory. These jars will act as data publishers of WSO2 ESB.
    1. gson-2.1.jar
    3. libthrift-0.7.wso2v1.jar   
    6. org.wso2.carbon.eventbridge.agent.thrift-3.2.3.jar
    8. org.wso2.carbon.eventbridge.commons-3.2.3.jar
    10. org.wso2.carbon.eventbridge.commons.thrift-3.2.3.jar
    12. org.wso2.carbon.statistics-3.2.4.jar
    14. org.wso2.carbon.utils-3.2.3.jar
The above jars can be downloaded from the FTP Location

  1. Start up the WSO2 AS with the following command from the ESB_HOME/bin directory.
  1. Log into the management console with the credentials. Go to “Configure” tab. You will see a new feature has been listed in the menu named “Service Data Publishing”. When you clicked on the the feature, the UI will be as follows.

  1. Check the “Enable Service stats” check box under “Service Configuration”.
  2. Specify the Stream Definition Configuration parameters as preferred.
  3. Specify the “BAM URL” under “BAM Credential” in the following format.
tcp://<ip_address>:7611 (eg:  tcp://

  1. Click on “Update”.

PS: Similarly, you can configure the other carbon server nodes as well (eg: WSO2 BPS, WSO2 DSS and WSO2 AS)

Configure Standalone WSO2 BAM and Monitor Data

  1. Change the port offset of WSO2 BAM server, so that it will not get port clashes with earlier configured WSO2 ESB.
Change the <Offset> parameter in carbon.xml file that resides in BAM_HOME/repository/conf directory.
  1. Start up the server with the following command from the BAM_HOME/bin directory.
  1. Invoke the service/s deployed in WSO2 ESB.
  2. Login to the WSO2 BAM Management Console. Go to “Main” tab --> “Manage” menu --> “Cassandra Explorer” --> “Connect to Cluster”.
Provide the following inputs
Connection URL: localhost:9160
Username: admin
Password: admin
Click on “Connect”.
  1. This will list the “Keyspaces”. Analyze the details of the respective Stream Name  under  “EVENT_KS” keyspace. A sample record will be as follows.
With these details, create a BAM Archive package and deploy as a “BAM Toolbox”.

  1. Create a Toolbox that contains the following components.
    1. Database script
    2. Gadget XMLs
    3. Jaggery scripts
The Toolbox should be packaged to a “.bar” package. The sample Toolbox can be found from the FTP location

  1. Deploy the Toolbox from “Main” tab --> “Manage” menu --> “BAM Toolbox” --> “Add” from the WSO2 BAM management console.

  1. From the Custom Toolbox table, browse for the created .bar package and hit on “Deploy”.
  2. Until the complete deployment, the status of the package will be shown as “Awaiting to Deploy”.

  1. Refresh the page until the status changes to “Deployed”.

  1. Go to “Main” tab --> “Manage” menu --> “Analytics” --> “List Scripts”.
  2. Click on “Edit”.

  1. This will open up the Script Editor and it will show the Database script that we have included in the deployed .bar package. Click on “Run”.

  1. With the successful execution of the script, it will show up the Results in the “Script Results” section below the “Script” editor section.
  2. Go to “Main” tab --> “Dashboard” menu --> “BAM Dashboard”. The deployed gadgets on the dashboard will be shown as follows.

Tuesday, August 28, 2012

Authentication on a deployed Web App??

Enterprises use Java Web Applications for various requirements. Often these applications may require to be implemented with access control and authentication as an organization policy. 
In the provided article, I have showed how WSO2 Application Server acts as a deployment container for a web application and authenticate the hosted application against a preferred User Store. Furthermore, the write-up focuses on enforcing secure connections via HTTPS enablement on the Web Application.