Overview

An API Gateway provides a unified interface for a set of microservices so that clients do not need to know about all the details of microservices internals.

Digit uses Zuul as an edge service that proxies requests to multiple back-end services. It provides a unified “front door” to our ecosystem. This allows any browser, mobile app or other user interface to consume underlying services.

Pre-requisites

Before you proceed with the documentation, make sure the following pre-requisites are met -

Key Functionalities

Zuul Components

Zuul has mainly four types of filters that enable us to intercept the traffic in different timeline of the request processing for any particular transaction. We can add any number of filters for a particular url pattern.

Zuul Features

Configuration

Routing Property

For each service, below mentioned property has to be add in routes.properties

-zuul.routes.{serviceName}.path = /{context path of service}/**
-zuul.routes.{serviceName}.stripPrefix = {true/false}
-zuul.routes.{serviceName}.url = {service host name}

Rate Limiting Property

For endpoints which requires rate throttling, below mentioned property has to be added in limiter.properties

-zuul.ratelimit.policy-list.{serviceName}[0].limit={request number limit per refresh interval window}
-zuul.ratelimit.policy-list.{serviceName}[0].quota={request time limit per refresh interval window (in seconds)}
-zuul.ratelimit.policy-list.{serviceName}[0].refresh-interval={refresh interval in seconds}
-zuul.ratelimit.policy-list.{serviceName}[0].type[0]=url={url of API endpoint}
-zuul.ratelimit.policy-list.{serviceName}[0].type[1]={type of throttling eg: user, origin etc.}

Deployment Details

  1. Deploy the latest version of zuul service.

  2. Add zuul routing context paths and service host name in configuration.

Integration

Integration Scope

The zuul service is used to act like an API gateway for services which citizens avail from ULBs.

Integration Benefits

Steps to Integration

  1. To integrate, host of zuul module should be overwritten in helm chart.