...
1. Download WSO2 BAM 2.0 from location: http://wso2.com/products/business-activity-monitor.
2. Open the file api-manager.xml at location <AM_HOME>\repository\conf folder.3. Enable its API tracking option by setting the "APIUsageTracking" element to true in <AM_HOME>\repository\conf\api-manager.xml file as follows:.
Code Block | ||
---|---|---|
| ||
<APIUsageTracking> <!-- Enable/Disable the API usage tracker. --> <Enabled>true</Enabled> <PublisherClass>org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher</PublisherClass> <ThriftPort>7612</ThriftPort> <BAMServerURL>tcp://localhost:7612/</BAMServerURL> <BAMUsername>admin</BAMUsername> <BAMPassword>admin</BAMPassword> <!-- JNDI name of the data source to be used for getting BAM statistics. This data source should be defined in the master-datasources.xml file in conf/datasources directory. --> <DataSourceName>jdbc/WSO2AM_STATS_DB</DataSourceName> </APIUsageTracking> |
43. Configure the data source definition used in the above configuration in <AM_HOME>\repository\conf\datasourcesmaster-datasources.xml file as shown below.
Code Block | ||
---|---|---|
| ||
<datasource> <name>WSO2AM_STATS_DB</name> <description>The datasource used for getting statistics to API Manager</description> <jndiConfig> <!-- This jndi name should be same as the DataSourceName defined in api-manager.xml --> <name>jdbc/WSO2AM_STATS_DB</name> </jndiConfig> <definition type="RDBMS"> <configuration> <!-- JDBC URL to query the database --> <url>jdbc:h2:<BAM_HOME>/repository/database/APIMGTSTATS_DB;AUTO_SERVER=TRUE</url> <username>wso2carbon</username> <password>wso2carbon</password> <driverClassName>org.h2.Driver</driverClassName> <maxActive>50</maxActive> <maxWait>60000</maxWait> <testOnBorrow>true</testOnBorrow> <validationQuery>SELECT 1</validationQuery> <validationInterval>30000</validationInterval> </configuration> </definition> </datasource> |
Info | ||
---|---|---|
| ||
In the above configuration,
|
4. Restart the API Manager.
...