feign调用成功,为什么进入了fallback?

Blade 未结 2 1143
guoqingshan
guoqingshan 剑圣 2021-01-28 18:49

一、该问题的重现步骤是什么?

1. 

@PostMapping(DEPT_SAVE)
R<String> saveDept(@RequestBody Dept dept);

2. 

public class ISysClientFallback implements ISysClient {
@Override
public R<String> saveDept(@RequestBody Dept dept) {
   return R.fail("保存数据失败");
}

3. 


2021-01-28 18:10:45.322  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : {"id":null,"tenantId":"097108","parentId":"1287898831669182465","deptName":"1111","fullName":"1111","areaCode":"411001","areaName":null,"deptUscc":"1111","ancestors":"0,1287945683735764993","deptCategory":11,"sort":null,"remark":null,"isDeleted":null}

2021-01-28 18:10:45.322  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : --> END POST (251-byte body)

2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : <-- 200 OK http://172.16.0.136:8106/client/dept-save (48ms)

2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : Connection: keep-alive

2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : Transfer-Encoding: chunked

2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : Content-Type: application/json;charset=UTF-8

2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : Date: Thu, 28 Jan 2021 10:08:58 GMT

2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : 

2021-01-28 18:10:45.373  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : {"code":200,"success":true,"data":{},"msg":"成功"}

2021-01-28 18:10:45.373  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : <-- END HTTP (52-byte body)

 跟踪记录feign调用成功,为什么进入了fallback?


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?


四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。

2条回答
  • 2021-01-28 19:36

    调用超时

    0 讨论(0)
  • 2021-01-28 19:40

    是每次调用都这样还是个别情况这样?有可能是请求的时候有返回结果,但是整个调用超过了时间,也会返回fallback。

    目前根据你提供的日志还不够判断,如果有报错的话贴完整,或者你精简一个可以重现错误的独立工程,打包传到帖子,后续我们下载帮你调试下看看问题所在

    作者追问:2021-01-29 09:14

    2021-01-28 18:10:45.372  INFO 23780 --- [-blade-system-3] o.s.core.cloud.http.OkHttpSlf4jLogger    : <-- 200 OK http://172.16.0.136:8106/client/dept-save (48ms)

    整个post 耗时  48ms


    0 讨论(0)
提交回复