当前位置:网站首页>Local call feign interface message 404

Local call feign interface message 404

2022-04-23 20:06:00 qq_ forty-three million four hundred and thirty-two thousand an

First, ensure that both local services are registered in the same registry , Then the following error is reported in the call :

call feign Failure :status 404 reading XxFeign#Xx(XxDataVO)

The reason is that... Is configured in the configuration file of the called service url And feign Configured during interface call url It doesn't match ;servlet: context-path: The back url As a whole url Part of , and feign The path written by the interface annotation is incomplete ;

#  The configuration file of the called service 
servlet:
  context-path: /data
//  Calling the service feign Interface 
@PostMapping("/push")
ServiceResult pushData(@RequestBody ReqPushDataVO reqPushDataVO);

Solution :
1. Comment out servlet: context-path To configure ;
2.feign The interface annotation is full path @PostMapping("/data/push");
Either way .

版权声明
本文为[qq_ forty-three million four hundred and thirty-two thousand an]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231946348824.html