Calling methods from FeignClient

Viewed 33

can I make it so that configuration = ClientConfiguration.class is used ONLY when calling the getCounterparty method?

@FeignClient(
        decode404 = true,
        url = "${config.client.srm-project.url}",
        name = "${config.client.srm-project.name}",
        configuration = ClientConfiguration.class)

public interface SrmProjectClient {


    @GetMapping(value = "/counterparty")
    CounterpartyDto getCounterparty(@RequestParam(value = "counterpartyId") UUID counterpartyId);

    @GetMapping("/user/current")
    UserResDto getCurrent(@RequestHeader("Authorization") String token);

P.S. I just created two separate interfaces. I wanted to do without it but there is no choice. Thanks

1 Answers

@FeignClient has as @Target(value=TYPE) so you cannot apply it on method. But you can specialize your code: make two FeignClient(s) and put in the one that all your methods that deponds on this configuration hope this will help

Related