Enabling the Zuul service proxy

Now add the @EnableZuulProxy annotation on top of the ApiZuulServiceApplication Spring Boot application class. This annotation will enable the Zuul service proxy in our application and will also enable all the features of an API Gateway layer. Along with the @EnableZuulproxy annotation, we have also added another @EnableDiscoveryClient annotation on top of the ApiZuulServiceApplication class. Let's see the following main application class of the api-gateway-service application:

package com.dineshonjava.apizuulservice;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.client.discovery.EnableDiscoveryClient;import ...

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.