Questions tagged [spring-cloud-gateway]

Spring Cloud Gateway is an API Gateway library on top of the Spring reactive ecosystem. Use this tag when encountering issues with Spring Cloud Gateway components.

spring-cloud-gateway provides a library for building an API Gateway on top of Spring MVC. 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.)..

1147 questions
7
votes
2 answers

How to modify the response body in Spring Cloud Gateway just before the commit

I'm using Spring Cloud Gateway with Spring 5, Spring Reactor and Netty for a project. For every request send to the gateway I want to do something just before the response is sent to the client. The best way I have found to do it is to add an action…
Pit
  • 71
  • 1
  • 2
  • 6
6
votes
4 answers

Spring Cloud Gateway doesn't work with DiscoveryClientRouteDefinitionLocator

I was working with Spring cloud gateway when i use routes statique like this (It works fine) : @Bean RouteLocator routeLocator(RouteLocatorBuilder builder) { return builder.routes() .route((r) ->…
Ayoub Jebji
  • 249
  • 1
  • 3
  • 12
6
votes
1 answer

ServletInitializer file is created every time I create spring boot project from spring.io

Every time I create a project from spring.io a ServletInitializer file is created inside the project. I only have the spring cloud gateway dependency. Is this the reason this file exists, and if yes, could someone please explain why? These are its…
C96
  • 477
  • 8
  • 33
6
votes
0 answers

How to override default-filters args at route level in spring cloud gateway?

spring: cloud: gateway: default-filters: - name: AuthFilter args: enabled: true routes: - id: route uri: "${SERVICE1:http://localhost:8080}" predicates: -…
6
votes
2 answers

How to configure netty connection-timeout for Spring WebFlux

I am running spring cloud gateway (which I understand to be built on Spring Webflux) behind an AWS loadbalancer and I am receiving intermittent 502 errors. Upon investigation, it appears the issue has to do with connection timeouts between the…
brunch
  • 623
  • 1
  • 6
  • 11
6
votes
3 answers

Spring cloud gateway unable to resolve service id from eureka server

Followed the spring guides to build the eureka server, spring cloud gateway and a sample rest service. However, the gateway is unable to retrieve the urls using the service name from the eureka server. The registering of the gateway and service…
6
votes
0 answers

Simple Gateway Using Spring Cloud Gateway - ProxyExchange

I wanted to write a simple gateway using spring cloud, so that requests to a third party would appear to come from my service (as I have done so in the past with Zuul). The example on the github page and likewise in the official docs seems to be…
Vince
  • 955
  • 1
  • 10
  • 22
5
votes
3 answers

How to get trace-id in spring-cloud-gateway using micrometer-brave

I want to display traceId in logs for each request in Spring Cloud Gateway. However, traceId and spanId are just empty. Log config is like below: logging: pattern: level: "%5p [TRACE_ID: %X{traceId:-}] [SPAN_ID: %X{spanId:-}]" Part of…
Murad Zulfugarov
  • 359
  • 1
  • 4
  • 14
5
votes
3 answers

Spring Cloud Gateway doesn't find the microservices (Not found 404 error)

I have this simple microservices application with Spring Boot and I try to add the Spring Cloud Gateway service, but it doesn't work. All microservices, including the Eureka server, work well, but when I try to access to some microservice using the…
5
votes
1 answer

Spring Cloud Gateway Custom Gateway Filter Not Working

I'm trying to debug my application, but debugger not hitting this code block. Here is my custom gateway filter. @RefreshScope @Component public class AuthorizationHeaderFilter extends …
isa_toltar
  • 586
  • 5
  • 11
5
votes
3 answers

No servers available for service: while routing in Netflix ribbon

I had below working code in spring boot 2.3.4 public Route.AsyncBuilder apply(PredicateSpec route) { return route .path("/api/external/**") .filters(f -> f .removeRequestHeader("Cookie") …
5
votes
1 answer

Spring Cloud Gateway with spring-boot-starter-web

I am creating gateway for Spring Boot microservices using Spring Cloud Gateway. Gateway is also responsible for JWT authorization using Spring Security. public class JwtAuthorizationFilter extends BasicAuthenticationFilter { ... @Override …
5
votes
13 answers

Spring Cloud API Gateway routing not working

I have designed a micro service prototype using below technologies Eureka Server a service Spring Cloud API Gateway Above mentioned service are registered in the Eureka Server API Gateway routing…
arj
  • 887
  • 1
  • 15
  • 37
5
votes
2 answers

How to set a time out in spring cloud gateway?

How to set a time-out in spring cloud gateway? routeLocatorBuilder.routes() .route("test-api", r -> r.path("/api/**")).uri(apiLb)) .route("test-doc", r -> r.path("/doc/**")).uri(docLb)); Is there a way to set a time out for just one…
Thirumal
  • 8,280
  • 11
  • 53
  • 103
5
votes
0 answers

Intermediate authorization_request_not_found error with Spring Cloud Gateway and Keycloak

I am working on a microservice architecture developed in Spring boot with an API gateway service using Spring Cloud Gateway. I am using Keycloak as an identity provider. Everything is working fine normally, but I am getting intermediate…
1 2
3
76 77