-
Notifications
You must be signed in to change notification settings - Fork 2.4k
How It Works 2.0
At a high level view, Zuul 2.0 is a Netty server that runs pre-filters (inbound filters), then proxies the request using a Netty client and then returns the response after running post-filters (outbound filters).
The filters are where the core of the business logic happens for Zuul. They have the power to do a very large range of actions and can run at different parts of the request-response lifecycle as shown in the diagram above.
- Inbound Filters execute before routing to the origin and can be used for things like authentication, routing and decorating the request.
-
Endpoint Filters can be used to return static responses, otherwise the built-in
ProxyEndpoint
filter will route the request to the origin. - Outbound Filters execute after getting the response from the origin and can be used for metrics, decorating the response to the user or adding custom headers.
There are also two types of filters: sync and async. Since we're running on an event loop, it's CRITICAL to never block in a filter. If you're going to block, do so in an async filter, on a separate threadpool -- otherwise you can use sync filters.
For more information check out the Filters page.
A Netflix Original Production
Tech Blog | Twitter @NetflixOSS | Jobs
-
Zuul 2.x
-
Zuul 1.x