Closed
Description
Eugene Tenkaev opened SPR-17622 and commented
Following this approach here http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance
If you add root @RequestMapping
to the UserService
it will be registered as handler in Spring MVC application.
Example project to reproduce here https://github.com/Hronom/test-shared-mapping-interface
Related discussions:
- @FeignClient with top level @RequestMapping annotation is also registered as Spring MVC handler spring-cloud/spring-cloud-netflix#466
- https://stackoverflow.com/questions/29284911/can-a-spring-cloud-feign-client-share-interface-with-an-spring-web-controller
To handle this properly need to avoid registration of controller that has only @RequestMapping
annotation.
Proposed solution:
Register handler only if it has annotation @Controller
or @RestController
.
Affects: 5.1.3
Issue Links:
- Introduce proxy-based REST client similar to HttpInvokerProxyFactoryBean [SPR-12131] #16747 Introduce proxy-based REST client similar to HttpInvokerProxyFactoryBean
1 votes, 3 watchers