Advertisement

Gateway出现org.springframework核心IO缓冲区异常:已达到最大字节数限制

阅读量:

Spring Boot 版本:2.6.6

Spring Cloud Gateway 版本:3.1.1

在 Gateway 的自定义过滤器中,对请求 ServerRequest 进行了重新定义。随后架构进行了升级,原先旧版本未对请求参数的容量进行约束(默认值为-1),而在后续版本中该限制被调整为 256KB。

解决方案如下:

方案一与方案二在本人所使用的 SpringBoot 版本中均未产生效果,建议各位可以逐一尝试,或许能够奏效。

一、配置文件的设置(未成功)

复制代码
    spring:
      codec:
    max-in-memory-size: 50MB
    
    
      
      
      
    

二、配置 Bean 的添加过程(未成功)

复制代码
    @Configuration
    @EnableWebFlux
    public class WebFluxWebConfig implements WebFluxConfigurer
    {
    	@Override
    	public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
    		configurer.defaultCode

全部评论 (0)

还没有任何评论哟~