Repolode
spring-cloud

spring-cloud/spring-cloud-gateway

An API gateway built on Spring Framework and Spring Boot for routing and filtering HTTP requests in microservice setups.

Stars
4,919
Forks
3,481
Open issues
565
Last commit
18 hours ago

What is it?

Spring Cloud Gateway is an API gateway for Java applications built on Spring Framework 6 and Spring Boot 3, running on Java 17. It sits in front of backend services and routes incoming HTTP requests to them based on matching rules such as path, HTTP method, header, or host.

Routes are scoped filters: each filter applies only to the requests that match its route. Filters can add, remove or rewrite headers and parameters, rewrite or set the request path, and apply features such as a circuit breaker. Routes can be defined through the API or through configuration, and can also be populated from a Spring Cloud DiscoveryClient.

The project is built with Maven using the included ./mvnw wrapper and requires JDK 17. Tests that depend on middleware such as Redis need a local Docker instance running.

Key features

  • 01Route matching on path, method, header, host and other request attributes
  • 02Filters scoped to individual matching routes
  • 03Filters can modify request and response headers, parameters and paths
  • 04Circuit breaker support among built-in filters
  • 05Routes configurable via API or configuration, or from Spring Cloud DiscoveryClient

Use cases

  • Front-end routing for a set of Spring Boot microservices
  • Adding or rewriting headers and paths before requests reach backend services
  • Integrating service discovery so routes follow registered services

Quick start

  1. 1

    Clone the project repository

  2. 2

    Install JDK 17 and build the source with the Maven wrapper

    ./mvnw install

Things to know

  • Requires JDK 17 to build.
  • Some tests need a local Docker instance running.

In collections

Topics

FAQ

What is spring-cloud-gateway?
An API gateway built on Spring Framework and Spring Boot for routing and filtering HTTP requests in microservice setups. Spring Cloud Gateway is an API gateway for Java applications built on Spring Framework 6 and Spring Boot 3, running on Java 17. It sits in front of backend services and routes incoming HTTP requests to them based on matching rules such as path, HTTP method, header, or host.
Is spring-cloud-gateway free to use? What license does it have?
spring-cloud-gateway is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is spring-cloud-gateway still maintained?
Actively maintained. The last commit to spring-cloud-gateway was on Nov 6, 2026.
What can I use spring-cloud-gateway for?
Front-end routing for a set of Spring Boot microservices Adding or rewriting headers and paths before requests reach backend services Integrating service discovery so routes follow registered services
How do I install spring-cloud-gateway?
Clone the project repository Install JDK 17 and build the source with the Maven wrapper: ./mvnw install
Where can I get spring-cloud-gateway?
The source code and installation instructions are on GitHub: https://github.com/spring-cloud/spring-cloud-gateway

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects