Spring Boot Application With Zull API Gateway
Posted By : Deepak Maurya | 10-Sep-2020
Zuul server is an API Gateway application. It handles all the requests and performs the dynamic routing of microservice applications.All Netflix traffic first goes to a Zuul cluster which is mainly responsible for dynamic routing, monitoring, resiliency and security based on different filters.
There are four types of filters in Zull that enable us to intercept the traffic. We can add any number of custom filters for a particular url pattern.
Pre filters – Pre filters are invoked before the request is routed.
Post filters –Post filters are invoked after the request has been routed.
Route filters –Route filters are used to route the request.
Error filters – Error filters are invoked when an error occurs while handling the request.
Add Maven Dependecy
Adding Main Class in ApiGateWay Service (Zull Application)
@EnableZuulProxy annotation is used to make your Spring Boot application act as a Zuul Proxy server.
@EnableEurekaClient makes this application an Eureka client, so that it can interact with the service registry and obtain the required information .
Configuration for Application.properties file.
These are the two most important properties which enable Zuul to perform request routing.
If a request comes to the /user-service/* URL path, that request will be directed to the service registered with service-id user-service.
Testing The Application
We, at Oodles Technologies, provide full-scale SaaS app development services to build scalable, responsive, and quality-driven web and mobile applications. Contact us for technical assistance or drop us a line at email@example.com for more detail.