Zuul implementation of API gateway and request filtering in spring cloud introductory tutorial
brief introduction
Zuul is Netflix's JVM based router and server-side load balancer. The most common scenario is to replace the nginx reverse proxy background micro service for front-end UI access.
Zuul uses the ribbon to locate an instance forwarded through discovery. All requests are executed with the hystrix command, so the fault will be displayed in the hystrix index.
Note: zuul does not include the discovery client. Therefore, for the route based on service ID, you need to provide one of the routes in the classpath
Zuul is an API gateway and filtering component provided by spring cloud. It provides the following functions:
In this tutorial, we will use zuul to forward the web request / product to the corresponding product service, and define a pre filter to verify whether it has been forwarded by zuul.
Basic environment
Project source code
click here