How netflix/zuul works
Project type and purpose
• This is a multi‑module Java/Gradle project implementing “Zuul,” a layer‑7 (HTTP) reverse proxy and API gateway.
• Purpose: dynamic routing, resiliency, monitoring, security, and push messaging for microservice architectures.
File structure
• Top‑level Gradle modules:
– zuul‑core: the main gateway implementation (Netty server, filter chain, client connection pooling, metrics).
– zuul‑discovery: server‑side component for resolving backend/origin servers.
– zuul‑processor: annotation processor for compile‑time filter discovery.
– zuul‑integration‑test: end‑to‑end test harness with embedded servers and test filters.
– zuul‑sample: example application demonstrating usage patterns (bootstrap, filters, push).
• Common patterns:
– Netty pipelines for async non‑blocking I/O.
– Filter chain pattern (com.netflix.zuul.filters).
– Connection pool abstraction.
– Annotation processing hook for filters.
• Build & CI: Gradle wrapper, multi‑project settings.gradle, GitHub workflows (snapshot, release, bench).
• Configuration: properties files under sample, dynamic property classes under core.
README insights
• Confirms that Zuul is a layer‑7 gateway with dynamic routing, resiliency, monitoring.
• No built‑in GUI; it’s a library/framework integrated into your JVM process.
• Suggests extension points via filters and dynamic property configuration.
– Runtime components (e.g., servers, pipelines)
– Build‑time components (annotation processor)
– External systems (origin services, config/discovery services)
– Request flow (client → gateway → origin)
– Response flow (origin → gateway → client)
– Dynamic resolution calls (gateway → discovery)
– Build‑time code generation (compiler → runtime metadata)
Detail
• Call out critical handlers (SSL initializer, idle timeout, access log) on the Netty pipeline.
• Metrics collection points for observability.
• If space allows, show thread/event loops vs user threads for non‑blocking behavior.