Skip to content

Spring Cloud Gateway Exceeded limit on max bytes to buffer : 262144 Error #3863

@liuxiaobo129

Description

@liuxiaobo129

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);
}
};
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions