All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reviewed

...

Multiple Gateways to handle production and sandbox requests separately

Having a single gateway Gateway instance to pass through both types of requests can negatively impact the performance of the production server. To avoid this, you can set up separate API Gateways. The production API Gateway handles requests that are made using PRODUCTION type tokens and the sandbox API Gateway handles requests that are made using SANDBOX type tokens.

...

You configure production and sandbox gateways Gateways using the <Environments> element in the <APIM<API-M_HOME>/repository/conf/api-manager.xml file, as shown in the following example:

Code Block
<Environments>
	<Environment type="production">
        <Name>Production</Name>
        <ServerURL>https://localhost:9445/services/</ServerURL>
        <Username>admin</Username>
        <Password>admin</Password>
        <GatewayEndpoint>http://localhost:8282,https://localhost:8245</GatewayEndpoint>
    </Environment>   
    <Environment type="sandbox">
        <Name>Sandbox</Name>
        <ServerURL>https://localhost:9448/services/</ServerURL>
        <Username>admin</Username>
        <Password>admin</Password>        
        <GatewayEndpoint>http://localhost:8285,https://localhost:8248</GatewayEndpoint>
    </Environment>
</Environments>

The <ServerURL> parameter should have the value of the environment instance. For information about the <GatewayEndpoint>, see Working with Endpoints.

The type attribute of the <Environment> element can take the following values:

  • Production: A production type Gateway
  • Sandbox: A sandbox type Gateway
  • Hybrid: The Gateway handles both types of tokens

If you work you work with Gateways in different geographical locations, configuring multiple environments using the <APIGateway> element in the <APIM <API-M_HOME>/repository/conf/api-manager.xml file is recommended. The diagram below depicts a sample setup:

Image Modified

Figure: API Gateways in different geographical regions