来获取spring.codec.max-in-memory-size的配置ServerRequest.create(exchange.mutate().request(serverHttpRequest).build(),codecConfigurer.getReaders()).bodyToMono(String.class).defaultIfEmpty("").doOnNext((objectValue) -> {if(StringUtils.isBlank(objectValue)) {...
spring:codec:max-in-memory-size:1048576 环境信息: Spring Boot 2.2.1.RELEASE 异常信息: 2021-02-04 15:39:33.014 [reactor-http-epoll-2] ERROR org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler - [1513c08e-1] 500 Server Error for HTTP POST "/x-service/pa...
OK,找到问题后,就可以修改我们的代码,在CustomReadBodyRoutePredicateFactory里,增加: @Value("${spring.codec.max-in-memory-size}")privateDataSize maxInMemory;@PostConstructprivatevoidoverrideMsgReaders(){this.messageReaders=HandlerStrategies.builder().codecs((c)->c.defaultCodecs().maxInMemorySize((int)...
OK,找到问题后,就可以修改我们的代码,在CustomReadBodyRoutePredicateFactory里,增加: @Value("${spring.codec.max-in-memory-size}") private DataSize maxInMemory; @PostConstruct private void overrideMsgReaders() { this.messageReaders = HandlerStrategies.builder().codecs((c) -> c.defaultCodecs().max...
Reopening #2694 , since the Issue was closed in favor of PR, but probably the review for the PR got lost. Describe the bug CacheRequestBodyGatewayFilterFactory doesn't respect spring.codec.max-in-memory-size The max in memory size is alw...
spring: codec: max-in-memory-size: 15MB Tried adding the configuration bean. @Configuration @EnableWebFlux public class WebFluxWebConfig implements WebFluxConfigurer { @Override public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) { configurer.defaultCodecs().maxInMemorySize(16 * ...
@Value("${spring.codec.max-in-memory-size}")privateDataSize maxInMemory;@PostConstructprivatevoidoverrideMsgReaders(){this.messageReaders = HandlerStrategies.builder().codecs((c) -> c.defaultCodecs().maxInMemorySize((int) maxInMemory.toBytes())).build().messageReaders(); ...
@ConfigurationProperties(prefix = "spring.codec")public class CodecProperties {private boolean logRequestDetails;private DataSize maxInMemorySize;} 加上配置后,日志如下: 2021-11-27 01:32:50,501 TRACE [sports,,] [17668] [reactor-http-nio-2][org.springframework.core.log.LogFormatUtils:88]:[ecf...
这就说明堆内存空间是正常的,结合OutOfDirectMemoryError的错误,可以判定为堆外内存泄漏了。jdk8默认的垃圾收集器是:UseParallelGC 这里我们可以改用CMS,来测试下:命令如下:java -jar -Xms6144m -Xmx6144m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/opt/logs/gateway.hprof -XX:SurvivorRatio=8 -...
•GatewayMEMKb: Sum of the total memory in kilobytes used by the gateway process. MaxMaximum value for the system counter for the aggregation time window. MinMinimum value for the system counter for the aggregation time window. AverageAverage value for the system counter for the aggregation ti...