Example of spring routing and filtering using spring-cloud-starter-netflix-zuul
Dependencies:
- spring-cloud-starter-netflix-zuul
- localhost: 8080 / in
- localhost: 8080 / out
In addition, a GatewayServiceZuul gateway is created to filter the routes of the rest service, in this service a FilterPre filter is created that runs before consuming any of the endpoints in RoutingFilteringExample microservice
obtaining as a result a console log message with the characteristics of the executed request
For the GatewayServiceZuul to function as a reverse proxy it is necessary to add the @EnableZuulProxy annotation and inject a bean of the FilterPre class