feign.FeignException: status 400 reading XXX 问题

背景:项目使用的是微服务架构,采用springboot来开发,所有的服务都是基于内嵌tomcat来运行

问题:项目部署到线上环境之后,有一天突然报错:Feign status 400 reading XXXX content:

原因:get请求参数太长,内嵌tomcat对参数的默认限制是8K
解决:在Feign接口提供端的微服务中修改tomcat对参数的默认值,如下:

server.max-http-header-size=20480

猜你喜欢

转载自blog.csdn.net/DingKG/article/details/87694068