September 07, 2022

nested exception is org.springframework.core.io.buffer.DataBufferLimitException | Exceeded limit on max bytes to buffer : 262144 | org.springframework.web.reactive.function.client.WebClientResponseException

Hi, While trying to implement a NSE Ticker for stockmarket analysis we encountered the below error

reactor.core.Exceptions$ErrorCallbackNotImplemented: org.springframework.web.reactive.function.client.WebClientResponseException: 200 OK from GET https://www.bijusapp/query?f=DAILY&symbol=adhani&apikey=bijusapp; nested exception is org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144
Caused by: org.springframework.web.reactive.function.client.WebClientResponseException: 200 OK from GET https://www.bijusapp/query?f=DAILY&symbol=adhani&apikey=bijusapp; nested exception is org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144


Solution


spring.codec.max-in-memory-size=50MB in application properties


Or


/**
 * 
 */


import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.ServerCodecConfigurer;
import org.springframework.web.reactive.config.EnableWebFlux;
import org.springframework.web.reactive.config.WebFluxConfigurer;

/**
 * @author bijusapp
 *
 */
@Configuration
@EnableWebFlux
public class WebFluxConfig implements WebFluxConfigurer {
@Override
public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
configurer.defaultCodecs().maxInMemorySize(16 * 1024 * 1024);
}

}

Facebook comments