February 2019
Intermediate to advanced
442 pages
11h 46m
English
We will create a Zuul proxy server as an independent Spring Boot service and register it with the Eureka discovery server. Create a new Spring starter project in Spring STS with Zuul, Eureka Discovery, and DevTool as dependencies.
Once created, open the bootstrap class and update it as follows:
@EnableZuulProxy@EnableDiscoveryClient@SpringBootApplicationpublic class ZuulApiGatewayApplication { public static void main(String[] args) { SpringApplication.run(ZuulApiGatewayApplication.class, args); }}
The @EnableZuulProxy annotation will make this service a Zuul server. We also need to register it with the Eureka discovery server with the @EnableDiscoveryClient annotation. Every service registered with the Eureka ...