0

I created a feign client in an item service, and I'm injecting it via a dependency in service A.

@FeignClient(name = "item",
        url = "${service.item.url}")
public interface ItemsClient {

    @RequestLine("POST /items")
    void saveItem(ItemCreationRequest request);


    @RequestLine("GET /items")
    ItemsDto getItems(@QueryMap ItemsFilter filter);
}

When I call the GET /items method from the item service inside service A, it doesn't see the specified GET method and calls the POST method in item service instead, because the endpoints are the same.

I've tried describing methods with spring annotations (such as @GetMapping and @RequestMapping), and with @RequestLine, but none of that helps.

And yes, I definitely need to describe the feign client in item service and implement it as a dependency in service A.

Please tell me what I'm missing and what are the options?

kerbermeister
  • 2,985
  • 3
  • 11
  • 30
pickstar
  • 21
  • 5

0 Answers0