A Java API gateway that proxies and governs traffic to HTTP, Dubbo, gRPC and other backends through a plugin chain.

8,908
3,107
Java
Apache-2.0
8 years old

Apache ShenYu is a Java-native API gateway for service proxying, protocol conversion and API governance. It fits teams that already run Java or Spring-based services and want a central place to route, authenticate, rate-limit and observe traffic in front of mixed backends.

How it works

Requests pass through an ordered plugin chain, with selector and rule matching determining which plugin acts on a given request. A separate ShenYu Admin service stores plugins, selectors, rules, metadata and auth data, then distributes changes to gateway replicas, which apply them to local caches. WebSocket sync is the default; HTTP long polling, ZooKeeper, Nacos and etcd are alternatives. Because routing lives in configuration rather than code, a route can be changed without redeploying the gateway. See the architecture overview and official docs.

What it can sit in front of

The gateway handles plain HTTP and Spring Cloud services, WebSocket connections, and Apache Dubbo and gRPC backends. Optional TCP and MQTT listeners add ingress paths. SOFA and Tars are no longer bundled: running those protocols requires installing the matching plugin-store starter in the gateway classpath, though Admin metadata and client SDKs continue to work.

On the governance side, plugins cover WAF, signing, authentication, load balancing, rate limiting, and fault tolerance via Resilience4j and Sentinel. The deprecated Hystrix option is an external plugin. Response caching can be in-memory or Redis-backed, and URL rewriting, redirection and request/response transformation are available. There is also an AI-facing set — AI proxy, prompt processing, token limits, sensitive-word filtering, and an MCP server plugin with SSE and Streamable HTTP.

Trying it locally

A Docker quick start brings up Admin, a gateway and an nginx example service using OpenSSL-generated secrets, then configures the divide plugin to forward /index.html and confirms the response comes back through the gateway. That route is applied to a single gateway instance and is not written to Admin, so it is a demonstration rather than durable configuration. For centrally managed routes, the README says to configure them in Admin with a persistent database instead of the default in-memory H2 database. The quick-start guide and downloads page are the starting points.

Requirements and caveats

ShenYu is Java-based and ships as Admin and bootstrap images plus Maven artifacts, so the quick start assumes Docker and OpenSSL. Extending it typically means Java: custom plugins, SPI implementations and WASM plugin APIs are the documented extension paths. The project is Apache-2.0 licensed.

A 2022 HN commenter said the project gave little indication of how it differs from comparable gateways (HN discussion); that is an opinion from the graduation thread, not a measured comparison, and the current docs above are the better reference for capability scope. The README does not present benchmark data or a validation of the gateway under production load, so sizing and performance claims would need independent testing.

Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.

Hacker News

Apache Shenyu Project Graduates
▲ 39 · 22 comments · September 20, 2022