Using @RequestLine with Feign

后端 未结 3 1702
北恋
北恋 2021-02-05 13:03

I have a working Feign interface defined as:

@FeignClient(\"content-link-service\")
public interface ContentLinkServiceClient {

    @RequestMapping(method = Req         


        
3条回答
  •  一生所求
    2021-02-05 13:30

    Spring has created their own Feign Contract to allow you to use Spring's @RequestMapping annotations instead of Feigns. You can disable this behavior by including a bean of type feign.Contract.Default in your application context.

    If you're using spring-boot (or anything using Java config), including this in an @Configuration class should re-enable Feign's annotations:

    @Bean
    public Contract useFeignAnnotations() {
        return new Contract.Default();
    }
    

提交回复
热议问题