Configuring an API gateway
How to configure an API gateway to receive API requests.
About this task
Attention: Because the synchronization interval is 1 second, do not use the local cache
first to enforce the rate limit with a 1-second interval. With this configuration, each peer can use
all available tokens during the interval. For example, a configuration of 10 tokens per second with
3 peers results in a condition where each peer can use 10 tokens.
To create an API gateway, define the following settings.
- The protocol handlers to receive API requests. The gateway can receive requests through only the HTTP and HTTPS handlers.
- The maximum intra-transaction and the maximum inter-transaction timeouts in seconds for API gateway to client connections.
- The API collections that package the plans and subscribers to serve a specific group of clients.
- The assembly rate limit schemes to enforce when added to a rate limit
assembly action. You can add one or more types of rate limit schemes.
- The assembly rate limit schemes to enforce.
- The assembly burst limit schemes to enforce. The burst limit prevents usage spikes that might
damage the infrastructure. The burst limit takes priority over the rate limit. When a message
arrives within an interval, the message is first checked against the burst limit schemes and then
against the rate limit schemes.
- When the burst limit is exceeded, the message is rejected.
- When the burst limit is not exceeded, the API gateway checks the message against the rate limit schemes.
- The assembly count limit schemes to enforce. The count limit restricts the number of requests in progress for subsequent actions. When the count limit is exceeded, an error is generated.
When you configure the API gateway, you can define the following settings.
- Whether to share rate-limiting data among all APIs under an application.
- The management of stylesheets.
- The stylesheet refresh policy that defines the rules to refresh stylesheets in the stylesheet cache.
- Stylesheet cache capacity, which depends on the availability of allocated memory.
- Whether to cache stylesheets with their SHA1 message digest value.
- Whether multiple calls from the same stylesheet return the same result.
- The load balancer group, or server pool, to provide redundancy among target resources.
- The document cache capacity and concurrent write behavior, where capacity depends on the availability of allocated memory.
- The connection policy that associates a set of URLs with a specific HTTP proxy. When multiple policies are defined, URLs are evaluated against each policy in order.
- The document cache policy to define how documents are cached and serve requests.
- The schedule to run specific processing rules.
For API gateway configurations defined in API Connect, the values for the following properties
are from API context variables.
- The value of the Comment field is the value of the
session.apiGatewayNameAPI context variable. - The value of the Gateway service name field is the value of the
session.apiGatewayAPI context variable.