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
79
questions
1
vote
2
answers
15k
views
How to get Original response body in Spring cloud gateway (Webflux) Post filter
I've implemented a Post filter in the spring cloud gateway. But I need the readable format (JSON Format of response body) before sending it to UI.
I'm getting exchange.getResponse(). (when i printed ...
29
votes
4
answers
68k
views
Spring Cloud Gateway - Proxy/Forward the entire sub part of URL
I am using Spring Cloud Gateway 2.0.0.M6 testing a simple gateway. I just want a URL to be forwarded to another URL with ** regex
Example 1: /integration/sbl/foo/bar => localhost:4178/a-integration/...
11
votes
5
answers
17k
views
Get request body string from ServerHttpRequest / Flux<DataBuffer>
I am using spring boot version - 2.0.6.RELEASE and spring cloud version - Finchley.SR2
and i have created my custom gateway filter to modify the request body.
but while converting the request body ...
111
votes
1
answer
53k
views
How is Spring Cloud Gateway different from Zuul?
I have been using Zuul as the edge service and API Gateway. Recently I have noticed that Spring Cloud Platform release Spring Cloud Gateway. What is the difference between the two gateways? Why is the ...
18
votes
4
answers
25k
views
Spring Cloud Gateway inject header
In the GatewayFilter, I am trying to inject a header into the request like below.
@Override
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
//DO ...
10
votes
3
answers
9k
views
use spring cloud gateway with oauth2
i face a problem when i using spring cloud gateway
is if any dependency call spring-boot-starter-tomcat directly or recursively
it will not work because it will start the embedded tomcat ...
10
votes
5
answers
22k
views
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()
....
9
votes
18
answers
50k
views
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 ...
7
votes
2
answers
16k
views
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 ...
5
votes
4
answers
5k
views
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{...
4
votes
2
answers
4k
views
Spring Cloud Gate Request Timeout Not working for path
In Spring cloud Gateway request timeout for path in not working as expected.
I tried to specify global timeout, but its not working as expected.
I am trying to call a microservice A. In A microservice ...
4
votes
1
answer
3k
views
Create route in Spring Cloud Gateway with OAuth2 Resource Owner Password grant type
How to configure a route in Spring Cloud Gateway to use an OAuth2 client with authorization-grant-type: password? In other words, how to add the Authorization header with the token in the requests to ...
4
votes
1
answer
8k
views
Spring Cloud Gateway POST Forbidden
I have a resource service behind Cloud Gateway route with RelayToken filter:
routes:
- id: apis
uri: http://rest-app:8080/apis
predicates:
- Path=/apis/**...
4
votes
1
answer
6k
views
How to disable global CORS config in Spring Cloud Gateway .yml config to allow requests from any origin?
I want to create a gateway service for my microservice app and I add the configs that mentioned in spring cloud gateway documentation to disable CORS in the gateway:
spring:
# GATEWAY CONFIG
cloud:...
3
votes
2
answers
9k
views
Spring Cloud Gateway - modify response body in global Post filter
I have spent the last 2 days trying every possible way of modifying the response body of a request before it hits the client, and nothing seems to work for me. So far I have tried the implementations ...