Creating a Gateway
We can use Spring Initializr to create our Discovery Server by visiting https://start.spring.io/.
We have chosen to create a Maven Project using Kotlin and Spring Boot 2.0.0 M7, we choose the Group to be com.microservices and the Artifact to be chapter06-gateway. For Dependencies, we have set Zuul, Eureka Discovery, and Config Client. Now we can click Generate Project to download it as a ZIP file. After we unzip it, we can open it with IntelliJ IDEA to start working on our Zuul server.
If our microservice is running, we now try to run the gateway. We will get an error since the 8080 port is already in use. We are going to modify our microservice to run on a random port since it will be exposed later in the gateway.
We will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access