I have a working Feign interface defined as:
@FeignClient(\"content-link-service\")
public interface ContentLinkServiceClient {
@RequestMapping(method = Req
I wouldn't expect this to work.
@RequestLine
is a core Feign annotation, but you are using the Spring Cloud @FeignClient
which uses Spring MVC annotations.
Your @RequestMapping
value looks ok, but you're likely should consider slightly rewriting it:
@GetMapping(value = "/{trackid}/links")
List<Link> getLinksForTrack(@PathVariable(name = "trackid") Long trackId);
Btw I did not succeeded with getting @RequestLine
to work due to same error as yours.
Also for @ReactiveFeignClients
Contract.Default()
yields to following errors:
java.lang.IllegalStateException: Method MyClient#doStuff(String,String) not annotated with HTTP method type (ex. GET, POST)
Warnings:
- Class MyClient has annotations [Component, ReactiveFeignClient, Metadata] that are not used by contract Default
- Method doStuff has an annotation GetMapping that is not used by contract Default
and should be fixed like:
var MyClient = WebReactiveFeign.builder()
.contract(new ReactiveContract(new SpringMvcContract()))
.target(MyClient, "http://example.com")
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();
}