A dynamic, high-performance API gateway built on NGINX and etcd, with plugins for routing, auth, rate limiting and AI/LLM traffic.
apache/shenyu
A Java-based API gateway for service proxying, protocol conversion, and API governance, with a plugin chain and a central Admin console.
Open-source alternative to:Kong
AWS API Gateway
- Stars
- 8,912
- Forks
- 3,111
- Open issues
- 353
- Last commit
- 19 hours ago
What is it?
Apache ShenYu is an API gateway written in Java. Requests pass through an ordered plugin chain, and ShenYu Admin stores plugins, selectors, rules, and metadata and pushes configuration to gateway replicas. Its Admin console handles centralized configuration, while gateway instances apply updates to their local caches.
The gateway proxies HTTP and Spring Cloud services, WebSocket connections, and Apache Dubbo and gRPC backends. It includes traffic control such as load balancing, rate limiting, and fault tolerance through Resilience4j and Sentinel, along with WAF, signing, authentication, caching, and URL rewriting. Recent additions cover AI proxying, token limits, and an MCP server plugin.
Service clients register addresses and API metadata with Admin, and an optional Kubernetes controller reconciles Ingress and Endpoints resources. Configuration sync supports WebSocket by default, with HTTP long polling, ZooKeeper, Nacos, and etcd available. Docker images are provided for quick startup.
Key features
- 01Ordered plugin chain with custom Java plugins and WASM plugin APIs
- 02Proxies HTTP, Spring Cloud, Dubbo, gRPC, and WebSocket upstreams
- 03Load balancing, rate limiting, and fault tolerance via Resilience4j and Sentinel
- 04Central Admin console that syncs configuration to gateway replicas
- 05Metrics and logging plugins with Kafka and Elasticsearch destinations
Use cases
- Putting a single entry point in front of microservices that mix HTTP, Dubbo, and gRPC
- Enforcing authentication, WAF rules, and rate limits on public APIs
- Proxying and governing calls to LLM providers with token limits and content filtering
- Running a Kubernetes-hosted gateway that reconciles Ingress resources
Quick start
- 1
Create the Docker network
docker network create shenyu - 2
Generate secrets and start the Admin, demo, and gateway containers as shown in the README
- 3
Configure the sample route on the gateway as shown in the README
- 4
Verify the route through the gateway
curl -i http://localhost:9195/index.html
Things to know
- The Docker quick start uses an in-memory H2 database by default, so a persistent database is needed for durable routes.
- SOFA and Tars are no longer bundled and need separate plugin-store starters.
- Apollo is deprecated and Hystrix is deprecated, so both should be avoided for new projects.
In collections
Topics
FAQ
- What is shenyu?
- A Java-based API gateway for service proxying, protocol conversion, and API governance, with a plugin chain and a central Admin console. Apache ShenYu is an API gateway written in Java. Requests pass through an ordered plugin chain, and ShenYu Admin stores plugins, selectors, rules, and metadata and pushes configuration to gateway replicas. Its Admin console handles centralized configuration, while gateway instances apply updates to their local caches.
- Is shenyu free to use? What license does it have?
- shenyu is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is shenyu still maintained?
- Actively maintained. The last commit to shenyu was on Nov 6, 2026.
- What can I use shenyu for?
- Putting a single entry point in front of microservices that mix HTTP, Dubbo, and gRPC Enforcing authentication, WAF rules, and rate limits on public APIs Proxying and governing calls to LLM providers with token limits and content filtering Running a Kubernetes-hosted gateway that reconciles Ingress resources
- How do I install shenyu?
- Create the Docker network: docker network create shenyu Generate secrets and start the Admin, demo, and gateway containers as shown in the README Configure the sample route on the gateway as shown in the README Verify the route through the gateway: curl -i http://localhost:9195/index.html
- Where can I get shenyu?
- The source code and installation instructions are on GitHub: https://github.com/apache/shenyu
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A Go RPC framework for building microservices, with pluggable service discovery, multiple transports and codecs, and cross-language access over HTTP.
An API gateway built on Spring Framework and Spring Boot for routing and filtering HTTP requests in microservice setups.
A high-performance, stateless, declarative API Gateway written in Go for routing, aggregating and securing calls to backend microservices.
Kong is a cloud-native, platform-agnostic API, LLM and MCP gateway, extensible through plugins, for routing and securing service traffic.
Open-source platform for dynamic service discovery, dynamic configuration management, and service metadata management in cloud native and microservice systems.