feign.FeignException: status 404 reading DeptClientService#queryAll()

今天使用feign面向接口,实现springcloud负载均衡出错了,如下图,访问的地址 localhost/consumer/dept/list

feign.FeignException: status 404 reading DeptClientService#queryAll()

feign.FeignException: status 404 reading DeptClientService#queryAll()

解决方案:

看自己的注册中心名字是否和@FeignClient是否匹配

feign.FeignException: status 404 reading DeptClientService#queryAll()
feign.FeignException: status 404 reading DeptClientService#queryAll()

如果正确,检查自己的Mapping是否正确

feign.FeignException: status 404 reading DeptClientService#queryAll()

感觉自己都没有问题,我再次启动项目,发现还是一样的错,这时候我 继续localhost/consumer/dept/list 还是报错,于是我试了一下localhost/consumer/dept/get/1,发现

feign.FeignException: status 404 reading DeptClientService#queryAll()发现正确。于是我知道是我的路径错了,最后发现这个接口的Mapping地址必须和服务提供者的Mapping地址一样
feign.FeignException: status 404 reading DeptClientService#queryAll()
feign.FeignException: status 404 reading DeptClientService#queryAll()

改成一样的就解决问题了

feign.FeignException: status 404 reading DeptClientService#queryAll()
脑壳疼!!!