Skip to content

How It Works 2.0

Arthur Gonigberg edited this page May 17, 2018 · 10 revisions

Architectural Overview

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).

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.