Spring Cloud Gateway


This project provides a library for building an API Gateway on top of Spring WebFlux. Spring Cloud Gateway aims to provide a simple, yet effective way to route to APIs and provide cross cutting concerns to them such as: security, monitoring/metrics, and resiliency.


Spring Cloud Gateway features:

  • Built on Spring Framework 5, Project Reactor and Spring Boot 2.0

  • Able to match routes on any request attribute.

  • Predicates and filters are specific to routes.

  • Circuit Breaker integration.

  • Spring Cloud DiscoveryClient integration

  • Easy to write Predicates and Filters

  • Request Rate Limiting

  • Path Rewriting

Getting Started

public class DemogatewayApplication {
	public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
		return builder.routes()
			.route("path_route", r -> r.path("/get")
			.route("host_route", r ->"*")
			.route("rewrite_route", r ->"*")
				.filters(f -> f.rewritePath("/foo/(?<segment>.*)", "/${segment}"))
			.route("hystrix_route", r ->"*")
				.filters(f -> f.hystrix(c -> c.setName("slowcmd")))
			.route("hystrix_fallback_route", r ->"*")
				.filters(f -> f.hystrix(c -> c.setName("slowcmd").setFallbackUri("forward:/hystrixfallback")))
			.route("limit_route", r -> r
				.filters(f -> f.requestRateLimiter(c -> c.setRateLimiter(redisRateLimiter())))

To run your own gateway use the spring-cloud-starter-gateway dependency.

Spring Initializr

Quickstart Your Project

Bootstrap your application with Spring Initializr.


Each Spring project has its own; it explains in great details how you can use project features and what you can achieve with them.
4.0.1 CURRENT GA Reference Doc.
4.0.2-SNAPSHOT SNAPSHOT Reference Doc.
3.1.5-SNAPSHOT SNAPSHOT Reference Doc.
3.1.4 GA Reference Doc.
3.0.8 GA Reference Doc.


Designed to be completed in 15-30 minutes, a guide provides quick, hands-on instructions for building a starter app for any development task with Spring.
Branch Initial Release End of Support End Commercial Support *
2022-12-19 2023-12-19 2025-04-19
2021-11-30 2023-11-18 2025-02-18
2020-12-21 2022-05-19 2023-09-19
2019-11-26 2020-11-26 2022-03-26

OSS support

Free security updates and bugfixes with support from the Spring community. See VMware Tanzu OSS support policy.

Commercial support

Business support from Spring experts during the OSS timeline, plus extended support after OSS End-Of-Life.
Publicly available releases for critical bugfixes and security issues when requested by customers.

Future release

Generation not yet released, timeline is subject to changes.

About commercial support (*)

This page shows the current state of project releases and does not define the commercial support policy. Please refer to the official support policy for more information.