Design a Service Gateway Using Zuul Reverse Proxy
Go Back to Course Outline Continuing on, Zuul is a router and a server-side load balancer developed and popularized by Netflix. Zu...
https://www.czetsuyatech.com/2019/10/spring-microservice-service-gateway-using-zuul.html
Continuing on, Zuul is a router and a server-side load balancer developed and popularized by Netflix. Zuul uses ribbon to call the remote services registered in a discovery server such as Eureka. By annotating a SpringBoot class with @EnableZuulProxy, a route is created for each service from the discovery client. As we add new services, routes are refreshed.
@EnableZuulProxy also enables 2 additional endpoints:
- Routes - a get to this endpoint returns a list of map routes, to get more details, add the query param format=details
- Filters - a get to this endpoint returns a map of Zuul filters
- Create a new SpringBoot and add the following dependencies
- spring-cloud-starter-netflix-zuul
- spring-cloud-starter-netflix-eureka-client - register this server to the service discovery
- spring-boot-starter-web and spring-boot-starter-actuator to expose server information
- Annotate the SpringBoot class with @EnableZuulProxy and @EnableDiscoveryClient.
- Configuration the application name, port, eureka instance and Zuul in the property file.
Run the projects in the following order
- Terawarehouse-config-server
- Terawarehouse-service-discovery
- Terawarehouse-load-balancer
- Terawarehouse-catalog
- <network_ip>:8000/catalog/default</network_ip>
- <network_ip>:8761</network_ip>
- <network_ip>:8001/api/v1/categories</network_ip>
- <network_ip>:8762/routes</network_ip>
- <network_ip>:8762/filters</network_ip>
- <network_ip>:8762/catalog/api/v1/categories</network_ip>
And that concludes this video. I hope this information will be of use to you when you decided to develop your own project using the microservice architecture.
I would appreciate if you could subscribe to my channel to get notified when I upload the next video and that will validate that what I’m doing is helpful for others, which will definitely inspire me to share more technical videos.
Post a Comment