Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

You can publish data as tenant When data is published to BAM by as tenants by only modifying the credetialscredentials, which receives the BAM events will be received as tenant and saves will be saved in tenant space in cassandraCassandra. You can publish the events using in below two different spaces,

  1. WSO2 Stratos Live

  2. Use Local BAM setup

...

the local BAM setup as follows.

In this section we shall modify the KPI sample and publish the data as tenant to BAM. Please follow the below instructions to publish data to the tenant space.

  1. Go to Modify the KPIAgent.java file in directory location $BAM_HOMEthe <PRODUCT_HOME>/samples/kpi-definition/src/main/java/org/wso2/carbon/bam/kpiagent.
    Modify the KPIAgent.java / directory as follows:

    noformat
    Code Block
    language
    java
    DataPublisher dataPublisher = new DataPublisher("tcp://" + host + ":7611", "tenantusername@tenantadmin.com", "admin123”, agent);
    Info
    Here In the above modification, the 'tenantusername' is Tenant the username of the tenant, which you have created and ', tenantadmin.com' is the domain name, which you have registered for the tenant. 'admin123' is the tenant passwordTenant password is admin123.
  2. Go Navigate to $BAM<PRODUCT_HOMEHOME>/samples/kpi-definition/ and directory from the command line, and run the ant script b by typing 'ant' from the command line. This will , to publish the events to your tenant space. 

  3. Go Log in to BAM admin management console and login as tenant. The go to Main → Cassandra Explorer → Connect to cluster and login to the cassandra cluster with tenant credentials.
    Eg:In the management console, click Main, then click Cassandra Explorer and then click Connect to cluster. Then log in to the Cassandra cluster using the tenant credentials as shown in the below example.

    No Format
    Connection URL = 9160 + <port-offsett>
    username = tenantusername@tenantadmin.com
    password = admin123
    
  4. Go to EVENYClick EVENT_KS and view the  published data in the org_wso2_bam_phone_retail_store_kpi (stream name) column family . And you can see the published data there.as follows: