webMethods API Gateway tutorial
Author: Jagadish, Dinesh (External)
Supported Versions: 10.1
Overview of the tutorial
This tutorial explains how an Elasticsearch in an external system can be configured in API Gateway as back end data store instead of the readily available EventDataStore that is shipped with API Gateway.
Required knowledge
- A basic understanding of API Gateway and its communication with EventDataStore for storing data
- A basic understanding of Kibana and its communication with EventDataStore to retrieve analytics data for rendering dashboards in API Gateway
Why?
API Gateway ships with EventDataStore, a wrapper product over ElasticSeach 2.3.2 (as of API Gateway 10.1), for storing data. But in some cases the API Provider might need API Gateway to connect to an external Elasticsearch for storing data. For example the Provider might already have a licensed Elasticsearch and would like to use that for API Gateway instead of going with the EventDataStore. Another case is, the Provider needs to create a new API Gateway instance in the Integration Server. This would not create a new instance of EventDataStore for it as only one instance of EventDataStore will be installed and exist for all the instances of API Gateway in the same installation. In this case the Provider can install an Elasticsearch instance outside the product or in an external machine and use it for the newly created API Gateway instance.
Prerequisite steps
Complete the below prerequisite steps before configuring external Elasticsearch in API Gateway.
- Install API Gateway advanced edition of version 10.1 and above
- Install external Elasticsearch instance of versions above 2.3.x
Details
The below section explains the configuration details need for connecting API Gateway to an external Elastisearch instance.
Changing Kibana configurations to connect to Elasticsearch
Now we need to modify the Kibana server configurations to connect to the Elasticsearch for rendering dashboards in API Gateway.
Open uiconfiguration.properties file from the directory <SAG-Home>\profiles\IS_instance_name\apigateway\config. Set apigw.es.url to http://<external elasticsearch host:port>, for e.g http://localhost:9200
Changing API Gateway configurations to connect to Elasticsearch
Follow the below steps to change the API Gateway configurations to connect to EventDataStore.
Go to <SAG_HOME>/IntegrationServer/instances/instance_name/packages/WmAPIGateway/config/resources/elasticsearch and open config.properties file. Set pg.gateway.elasticsearch.autostart to false.
Go to <SAG_HOME>/IntegrationServer/instances/instance_name/packages/WmAPIGateway/config/resources/beans and open gateway-es-store.xml file. Set the host name and port of the external Elasticsearch under elasticSearchClient bean id as below.
After making the configurations, start the Elasticsearch. After Elasticsearch is up and running, start the API Gateway. Now you would be able to login to API Gateway, create APIs and see the analytics page for dashboards.
Limitations
- These configurations are applicable for API Gateway versions 10.1 and below. For 10.2 and above refer Configuring External Elasticsearch for API Gateway 10.2
References
- Refer https://www.elastic.co/guide/en/elasticsearch/reference/2.3/_installation.html for Elasticsearch installation
Learn more
- Refer Configuring External Elasticsearch for API Gateway 10.2 for configuring external Elasticsearch for API Gateway version 10.2 and above
- Refer Securing Elasticsearch for API Gateway 10.2 for a tutorial on securing the Elasticsearch instance in API Gateway 10.2 and above