In this section, we will learn how to set up an edge server based on Spring Cloud Gateway.
Setting up a Spring Cloud Gateway as an edge server is straightforward and can be done by means of the following steps:
- Create a Spring Boot project using Spring Initializr as described in Chapter 3, Creating a Set of Cooperating Microservices—refer to the Using Spring Initializr to generate skeleton code section.
- Add a dependency to spring-cloud-starter-gateway.
- To be able to locate microservices instances though Netflix Eureka, also add the spring-cloud-starter-netflix-eureka-client dependency.
- Add the edge server to the common build file, settings.gradle:
include ':spring-cloud:gateway'
- Add a Dockerfile with the same content as for our microservices.
- Add the edge server to our three Docker Compose...