背景:项目使用的是微服务架构,采用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. c#中数组array和list在函数间传递 转置

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...

  2. 振动器(Vibrator)

    package com.wwj.serviceandboardcast;   import android.app.Activity; import android.app.Service; impo ...

  3. java 获取浏览器类型

    public String getBrowserType(HttpServletRequest request)   {     String type = "ie";     S ...

  4. jq+download+文件夹下载

    最近公司在做工程项目,实现文件夹下载. 网上找了很久,发现网上的代码都有相似的问题,不过最终还是让我找到了一个符合的项目. 工程: 进行项目文件夹下载功能分析,弄清楚文件夹下载的原理,提供的数据支持. ...

  5. org/apache/maven/cli/MavenCli : Unsupported major.minor version 51.0

    Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/maven/cli/Ma ...

  6. 2018-04-11 activity周期

    android相机开发 1.Android wifi热点连接过程 2.bindservice和AIDLhttps://blog.csdn.net/zhou_wenchong/article/detai ...

  7. TypeError: c is null

    找到相应的js报错地方..添加判断条件 if(styles == null) {     return ''; }

  8. spring配置Bean

    Bean   就是一个类 一下代码都是基于spring之IOC和DI实现案例基础上进行解析 Bean的实例化方式: 1.无参构造 <bean id="UserService" ...

  9. [置顶] 获取网络数据中的数组显示成ListView的简单流程

    首先说一下  这是我自己的个人笔记,如果想看看,不用看细节,可以看流程. 定义一个线程池 ExecutorService pool = Executors.newFixedThreadPool(15) ...

  10. SVN代码管理发布

    1.svn的独立模式应用 2.svn钩子的应用(例如:代码提交前的文件格式限制,大小限制,代码发布svn成功后的备份等等) 3.大型企业的代码发布流程 有一些制度流程.逻辑方案 4.业务变更管理