As of spring-projects/spring-framework#23884, Spring Framework supports configuring buffering limits on the webflux codecs (both client and server). We should add a configuration property for that, once we've decided what to do with #18827 first.

Comment From: egor-ryashin

maxInMemorySize is not available in:

<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
<version>2.2.3.RELEASE</version>

This won't compile:

ExchangeStrategies exchangeStrategies = ExchangeStrategies.builder()
                .codecs(configurer -> configurer.defaultCodecs().maxInMemorySize(1024 * 10)).build();
WebClient webClient = WebClient.builder().exchangeStrategies(exchangeStrategies).build();

I wonder why the issue was closed?

Comment From: bclozel

Hello @egor-ryashin, this issue is about adding a new spring.codec.max-in-memory-size configuration property in Spring Boot. This new property is available now, you can use it like this:

spring.codec.max-in-memory-size=1MB

Doing so will configure the default codecs to use this maximum size, and you can then configure your WebClient using the WebClient.Builder instance auto-configured by Spring Boot:

@Service
public class MyService {

    private final WebClient webClient;

    public MyService(WebClient.Builder webClientBuilder) {
        this.webClient = webClientBuilder.baseUrl("https://example.org").build();
    }

}

The code you're pointing at is not part of Spring Boot, but is actually Spring Framework. This code is used by Spring Boot for this feature and is tested, as shown in the linked commit on this issue.

Is your project overriding the Spring Framework version? Maybe there's a corrupt JAR in your local repository?

In any case, could you create a new issue with a project reproducing the problem?