I am getting error java.util.concurrent.ExecutionException: org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144| at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
In application .properties file i added
@Bean
public WebClient getWebClientBuilder(){
return WebClient.builder().exchangeStrategies(ExchangeStrategies.builder()
.codecs(configurer -> configurer
.defaultCodecs()
.maxInMemorySize(16 * 1024 * 1024))
.build())
.build();
}
and in service i am using
@Autowired
WebClient client;
also using client wherever it's needed
and added spring.codec.max-in-memory-size= 20MB in properties file it did not worked also i added one config file and added below mentioned inside it. But no luck.
package com.albertsons.pabssh.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.web.reactive.config.WebFluxConfigurer;
@Configuration
public class WebFluxConfiguration implements WebFluxConfigurer {
@Override
public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
configurer.defaultCodecs().maxInMemorySize(20 * 1024 * 1024);
}
}
Comment From: rstoyanchev
Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.
Also as an aside, there is not sufficient information provided. The issue could be with the client writing to a remote server, reading from a remote server, or with the local server receiving data, or writing response data. You can debug this further to narrow down the problem, but otherwise be sure to provide more details, like stack traces, an actual scenario, or sample.