spring-cloud / spring-cloud/spring-cloud-gateway
Spring Cloud Gateway Exceeded limit on max bytes to buffer : 262144 Error
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.9k
- Forks
- 3.5k
- Avg merge
- 20h 57m
- Merged PRs (30d)
- 8
Description
I uploaded a large JSON structure (a menu tree) from the frontend. When it reaches the gateway, it throws the following error:
DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144
I’m using Spring 6 and Spring Cloud Gateway 4.
The first approach doesn’t work
spring:
codec:
max-in-memory-size: 10MB
cloud:
gateway:
httpclient:
response-timeout: 30s
connect-timeout: 10000
The second approach doesn’t work
@Bean
public WebFluxConfigurer webFluxConfigurer() {
return new WebFluxConfigurer() {
@Override
public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
configurer.defaultCodecs().maxInMemorySize(10 * 1024 * 1024);
}
};
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the DataBufferLimitException with the large JSON menu tree and compare the two configuration approaches shown in the issue. Inspect Spring Cloud Gateway's codec and request-body handling entry points to determine which setting applies; done means the upload succeeds beyond 262144 bytes with a verified configuration or a documented defect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100