Skip to main content

All Questions

1 vote
1 answer
469 views

Spring Cloud Gateway MVC: unpredictable order of operation of custom filters

I am using Java21, Spring Boot 3.2 and spring-cloud-starter-gateway-mvc:4.1.1; I am trying to port the gateway (webflux) to gateway-mvc and in the gateway I need to call the authorization service, ...
Niyaz Khannanov's user avatar
0 votes
1 answer
709 views

Authenticate (or validate JWT) only at certain routes in Spring Gateway

My Setup looks like this: As you can see the Gateway gets all requests to route /api from an Angular. The Angular app authenticates the User with MSAL Lib to an Azure B2C, gets a token and makes ...
kism3t's user avatar
  • 1,361
0 votes
1 answer
140 views

Spring Gateway mutate response body on isError

I have requirement to mutate the response body for 4xx and 5xx responses. incoming response would look like { "reason": "sample reason" } I need to change that to { "...
rojanu's user avatar
  • 1,610
0 votes
1 answer
1k views

Spring cloud gateway request body to request header use by custom filter

I am new to webflux. I am having difficulty controlling data using webflux. Body data is missing in the controller when writing as below. Is there a solution? Data sent as body value is set as header ...
노민영's user avatar
1 vote
1 answer
2k views

How to increase max buffer size in ModifyRequestBodyGatewayFilterFactory in Spring Cloud Gateway

In my custom GatewayFilter, that extends ModifyRequestBodyGatewayFilterFactory, when I filter request heavier than 256 kb, I get DataBufferLimitException: org.springframework.core.io.buffer....
programmer's user avatar
0 votes
1 answer
147 views

Spring cloud gateway doesn't add context to styles/images when original context does not have trailing slash

Consider a request "http://localhost:gatewayport/myapp" where I want to redirect the request to "http://localhost:appport/" This works ok except that the images, styles hosted ...
Manisha's user avatar
  • 111
0 votes
0 answers
578 views

Use RequestInterceptor to intercept all request in Spring cloud gateway?

I have custom RequestInterceptor that implements org.apache.http.HttpRequestInterceptor. Is there a way to configure spring cloud gateway to intercept all the requests at this interceptor?
nikhil gs's user avatar
0 votes
1 answer
2k views

Microservices BFF pattern

We are working on application having micro-service based architecture with following components as shown in below image and not sure how BFF layer should be structured. We are currently considering ...
Gautam's user avatar
  • 3,386
10 votes
7 answers
13k views

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 ...
Karla Calero's user avatar
2 votes
1 answer
2k views

Gateway for micro services without ports

I need an API Gateway who'll be the "hub" for all my applications, but none of them will have ports cause they'll never be accessed directly and I can't chose a port since I don't know if ...
Alfredo Marin's user avatar
0 votes
1 answer
1k views

cachedRequestBodyObject is not working in spring cloud gateway custom filter factory

I am using spring cloud gateway for my project. I have written one custom filter factory for generating HMAC Signature which requires request payload. I have enabled readBody(String.class, requestBody ...
Sarminb's user avatar
  • 33
1 vote
2 answers
2k views

Spring Cloud Gateway: Does not route request, eventually encounter 413 request entity too large

I am trying to set up a simple Spring Cloud Gateway example. I have 2 docker containers running locally that will respond with AAA and ZZZ when the following endpoint is hit http://localhost:2000/...
Anomalyzero's user avatar
0 votes
1 answer
380 views

Redirect all non resolved endpoints to a specific registered service

I am trying to redirect all endpoints (which are not resolved by service-discovery) route to a specific url/lb. I have a spring cloud gateway server configured to resolve every /api request to via ...
Dhananjay's user avatar
  • 1,180
4 votes
0 answers
1k views

the gateway response 401 rather than redirect to login page

I am using the spring cloud gateway in my project, and i found the gateway will failed to route to the downstream service and response a status 401, and the downstream resource server's log show the ...
jianjun chang's user avatar
0 votes
2 answers
641 views

Spring cloud Gateway and Consul Server

Please help. I have Spring Cloud Gateway and Consul Server. In Spring Cloud Gateway i'm use "cloud:gateway:discovery:locator:enabled:true". I can send requests for services registered in the Consul (...
Иван's user avatar