A controller using the Resource annotations into B, C feign interface,
Call and then call C, B B fails, any call to 404, what reason be excuse me?
CodePudding user response:
May is a problem of interface addressCodePudding user response:
Success is not the first time, at the request of B, call C is also a success, but the next to come in, call it at 404 B, run directly call C code is a successCodePudding user response:
Can stick a B, C interface code, and feignclient codeCodePudding user response:
@ the ResourcePrivate ApiDocumentFeign ApiDocumentFeign;
@ the Resource
Private ApiUserFeign ApiUserFeign;
/* *
* first normal call
*/
@ PostMapping (value=https://bbs.csdn.net/topics/Urls.DocumentGroup.QUERY_LIST)
Public Result queryList (@ RequestBody QueryReq the req) {
//the first call success
The List res=apiDocumentFeign. QueryList ();
//the first call success
The USer the userInfo=apiUserFeign. Query ();
}
/* *
* the second failure to 404
* @ param the req
* @ return
*/
@ PostMapping (value=https://bbs.csdn.net/topics/Urls.DocumentGroup.QUERY_LIST)
Public Result queryList (@ RequestBody QueryReq the req) {
//the second every time call fails
The List res=apiDocumentFeign. QueryList ();
//
The USer the userInfo=apiUserFeign. Query ();
}
/* *
* the order after a success
*/
@ PostMapping (value=https://bbs.csdn.net/topics/Urls.DocumentGroup.QUERY_LIST)
Public Result queryList (@ RequestBody QueryReq the req) {
//the second every time call success
The USer the userInfo=apiUserFeign. Query ();
//the second every time call fails
The List res=apiDocumentFeign. QueryList ();
}
CodePudding user response:
Alone is no problem in a controller problemCodePudding user response:
If you feign interface configuration RequestMapping and corresponding feign controller configuration RequestMapping is different? Specific you can see herehttps://blog.csdn.net/qq_31404603/article/details/88421363
CodePudding user response:
This is a single service calls and my problem is not the sameCodePudding user response:
You mean the first request B and C are successful, the second failure, B or C is successful, you here refers to the first, service is restarted after it, is the first time you can get the interface response data, but the second you get the response as a result of the 404, this kind of look you can break, after the first request data, and the second failure of the request data, and then determine whether impact after the execution of the C B, or you can only temporarily does not perform C B, B will fail, this kind of problem, unless you have met, otherwise you can only step by stepCodePudding user response:
Emmmmm, this is not a code problem, should be the problem of feign invocation mechanism, to see someone asked before but nobody answer, is a consumer end only to perform a service end feignCodePudding user response:
I also encountered this problem, I am your rewrite rule, later you solved?CodePudding user response:
See won't B interface in some cases failed transaction rollback, cause the entire service chain are wrong