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,
WSO2 Stratos Live
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.
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:Code Block noformatlanguage 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 isadmin123
.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.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
- 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: