Close

2015-05-16

Zuul: Edge Service in the Cloud

Zuul

Zuul is an edge service that proxies request to multiple backing services. It provides a unified “front door” to your system, allowing a browser, mobile app, or user interface to consume services from multiple hosts without managing cross-origin resource sharing (CORS) and authentication. Mar 2, 2016

The official site is https://github.com/Netflix/zuul. 

At the center of Zuul is a series of filters capable of performing various actions while routing HTTP requests and responses. The following are the key characteristics of a Zuul filter:

  • Type: most often defines the stage during the routing flow when the filter will be applied (although it can be any custom string)
  • Execution Order: used within the Type, defines the order of execution across multiple filters
  • Criteria: the conditions required for the filter to be executed
  • Action: the action to be performed if the Criteria are met

Zuul provides a framework to dynamically read, compile, and run these filters. Filters do not communicate directly — instead, they share states through a RequestContext unique to each request.

Filters are currently written in Groovy, although Zuul supports any JVM-based language. The source code for each filter is written to a specified set of directories on the Zuul server that are periodically polled for changes. Updated filters are read from the disk, dynamically compiled into the running server, and invoked by Zuul for each subsequent request.