Technology Used

API Gateway Overview

The Zuul API Gateway is part of the Netflix OSS package. It is very lightweight and integrates well with Eureka. API Gateway is the single entry point into the microservice ecosystem from the outside world.

Main features of Zuul

Provides a unified access to multiple different microservices

Hides internal details of the microservice ecosystem

Load balances across multiple service instances

Allowes access to services

Restricts access to internal only services

Looks up services from Eureka

Implements filters for authentication or logging purposes

Zuul is yet another Spring-boot application. All we need to do is add the right annotation to the main class

Zuul integration with Eureka

If Zool is configured to access Eureka then it will look up all services and make them accessible externally. This is very convenient, but rather dangerous as internal only services might be exposed as well. A safer approach is to enable services one by one.

Redirect filter

The below filter redirects requests to a different server. It also demonstrates that filters can be written in groovy. The advantage (and danger) of groovy scripts is that they can be loaded from classpath, so the operations team can modify them without the need to release a jar / war file itself