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

问题:项目部署到测试环境之后,偶尔在后台日志会看到这样的日志:Feign status 400 reading XXXX content:

调查后发现是get请求参数太长的缘故,将参数打印出来,发现最长的有12KB,而内嵌tomcat对参数的默认限制是8K,在tomcat的org.apache.coyote.http11.AbstractHttp11Protocol类中定义了其默认值,如下:

/**
* Maximum size of the HTTP message header.
*/
private int maxHttpHeaderSize = 8 * 1024;
public int getMaxHttpHeaderSize() { return maxHttpHeaderSize; }
public void setMaxHttpHeaderSize(int valueI) { maxHttpHeaderSize = valueI; }

解决方案

  在Feign接口提供端的微服务中配置参数:

server:
max-http-header-size: 20480

Feign status 400 reading 问题分析的更多相关文章

  1. feign.FeignException: status 400 reading

    feign.FeignException: status 400 reading : 请求方调用报错: 服务方被调用报错: 用fegin给redis设置缓存时报错,刚好 卡到8k这个临界点 ,就一直报 ...

  2. fegin client使用http url合约时报: [Request processing failed; nested exception is feign.FeignException: status 400 reading

    首先看feign client代码: @FeignClient(name = "SPRING-CLOUD-WEB-PROVIDER-GROUP2", url = "htt ...

  3. SpringCloud使用Feign调用其他客户端带参数的接口,传入参数为null或报错status 405 reading IndexService#del(Integer);

    SpringCloud使用Feign调用其他客户端带参数的接口,传入参数为null或报错status 405 reading IndexService#del(Integer); 第一种方法: 如果你 ...

  4. spring cloud feign 报错 feign.FeignException$MethodNotAllowed: status 405 reading 解决

    1.前言 出现报错 feign.FeignException$MethodNotAllowed: status 405 reading XXXXX 需要检查 接口的请求参数是否一致 请求参数是否正确添 ...

  5. status 404 reading EduClient#getCourseInfoOrder(String)解决过程

    UcenterClient#getUserInfoOrder(String) failed and no fallback available.解决过程 报错内容: com.netflix.hystr ...

  6. HTTP Status 400 - Required String parameter 'userName' is not present 错误

    HTTP Status 400 - Required String parameter 'userName' is not present 错误 先mark  有时间详细写 参考链接: https:/ ...

  7. http status 400,http 400,400 错误

    转载:http://blog.csdn.net/xu_zh_h/article/details/2294233 4 请求失败4xx 4xx应答定义了特定服务器响应的请求失败的情况.客户端不应当在不更改 ...

  8. SpringMVC格式转化错误之HTTP Status [400] – [Bad Request]

    SpringMVC中,如果直接为Date类型的属性赋值,服务器有可能会报HTTP Status [400] – [Bad Request] Type Status Report Description ...

  9. HTTP Status 400 - description The request sent by the client was syntactically incorrect.

    HTTP Status 400 - type Status report message description The request sent by the client was syntacti ...

随机推荐

  1. Windows下Python安装: requires numpy+mkl 和ImportError: cannot import name NUMPY_MKL

    最近写了一篇关于“微软开源分布式高性能GB框架LightGBM安装使用”的文章,有小伙伴安装Python环境遇到了问题.我个人也尝试安装了一下,确实遇到了很多问题."Windows7下pyt ...

  2. js读取后端写入cookie出现乱码

    设置字符编码集即可 Cookie cookie = new Cookie("user",URLEncoder.encode(nMessage, "UTF-8") ...

  3. ORA-06553: PLS-553: character set name is not recognized, while starting Content Store

    Symptom CM-CFG-5029 Content Manager is unable to determine whether the content store is initialized. ...

  4. Nodejs的测试和测试驱动开发

    测试是保证软件质量必不可少的一环.测试有很多形式:手动.自动.单元测试等等.这里我们只聊使用Mocha这个框架在Nodejs中实现单元测试.单元测试是测试等重要组成,这样的测试只对于一个方法,这样的一 ...

  5. 《ARM Cortex-M3权威指南》笔记(1)

    http://blog.csdn.net/roverx/article/details/6624859 第1章 介绍 一.ARM Cortex‐M3处理器初探 CM3处理器内核是单片机的中央处理单元( ...

  6. 【python-crypto】导入crypto包失败的情况,怎么处理

    [python-crypto]导入crypto包失败的情况,怎么处理 是因为你自己安装的python的版本太高,所以自己降版本吧,捣鼓了一下午 pip install crypto pip insta ...

  7. java基础-day19

    第08天 异常 今日内容介绍 u  异常体系&异常处理 u  Throwable常用方法&自定义异常 u  递归 第1章   异常产生&异常处理 1.1      异常概述 什 ...

  8. java基础-day6

    第06天 java基础语法 今日内容介绍 u Eclipse断点调试 u 基础语法的练习 第1章   Eclipse断点调试 1.1      Eclipse断点调试概述 Eclipse的断点调试可以 ...

  9. Mac 下netstat和linux下不一样

    Linux's netstat command options and OS X(/BSD)'s have almost nothing to do with each other. Of the o ...

  10. 谈谈HashMap线程不安全的体现

    原文出处: Hosee HashMap的原理以及如何实现,之前在JDK7与JDK8中HashMap的实现中已经说明了. 那么,为什么说HashMap是线程不安全的呢?它在多线程环境下,会发生什么情况呢 ...