We can extend Multiple Gateway environments feature by utilizing dynamic endpoint capabilities of WSO2 API Manager to have each gateway point to a different back-end endpoint. API Gateway is the actual runtime of the APIs to which are developed and Published from the API Publisher. WSO2 API Manager is capable of publishing APIs to different gateways were the API users connect to those API Gateways in order to do the actual API calls through the applications they are subscribed. Refere Maintaining Separate Production and Sandbox Gateways for more information on publishing to multiple gateways.
However, when the API publisher can only provide a single static Endpoint for an API in the implementation. Therefore which ever the gateway that the API is deployed, the API call is dirceted to a single endpoint as depicted in the diagram below.
But in most situations, you would want to have each Gateway proxying a dedicated Back-End API. To provide that capability WSO2 API Manager provides ability to specify dynamic endpoint URLs at the time of specifying the API endpoint URL. This UEL will be resolved at the runtime with the details (host and port) we specify in the statup of each gateway. With that each gateway will point to dedicated backend APIs as depicted in the digram below.
Configuring Dynamic Endpoints
Follow the below step to Configure dynamic endpoint as the API endpoint.
- Start WSO2 API Manager Server which includes the API Publisher Component and create an API.
- Go to the implement phace of the API and replace Host and Port of the API endpoint with {urn}