我正在从应用程序调用另一个微服务,当数据较多时,我收到以下异常
nested exception is org.springframework.web.reactive.function.client.WebClientResponseException: 200 OK from GET https://ops-service.apps.com/api/v1/ops/list?page-size=150&page-offset=0; nested exception is org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144] with root cause
org.springframework.core.io.buffer.DataBufferLimitException: Exceeded limit on max bytes to buffer : 262144
at org.springframework.core.io.buffer.LimitedDataBufferList.raiseLimitException(LimitedDataBufferList.java:99) ~[spring-core-5.3.15.jar:5.3.15]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
我试图通过以下方法解决上述异常,但没有成功,仍然得到异常。在两个micorservices中的www.example.com中包含以下行application.properties。
spring.codec.max-in-memory-size=70MB
对于上述例外情况,有人有解决方案吗?
1条答案
按热度按时间sdnqo3pr1#
您需要定义一个自定义bean,如下所示:
或者,
学分:https://www.baeldung.com/spring-webflux-databufferlimitexception