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

Blade 未结 2 1166
guoqingshan
guoqingshan 2021-01-28 18:49

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

1. 

@PostMapping(DEPT_SAVE)
R saveDept(@RequestBody Dept dept);

2. 

public class ISysClientFallback implements ISysClient {
@Override
public R 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条回答
提交回复