Jerry
Jerry

Reputation: 145

Not able to resolve feign client name from application yml

I have a spring boot app and i am trying to use feign client to make a request to an endpoint but its not able to resolve feign client name from application yml. My application yml has following code :

ribbon:
  eureka:
   enabled: false
beacon:
  ribbon:
    isSecure: true
    listOfServers: https://beacon.org

My interface look like this :

@FeignClient("beacon")
public interface BeaconClient {

    @GetMapping("/api/organizations")
    List<Org> getOrgs();

}

I am getting an error 500 internal server error because i see that it making a request to http://beacon/api/organizations endpoint instead of https://beacon.org/api/organizations

Upvotes: 0

Views: 473

Answers (1)

夢のの夢
夢のの夢

Reputation: 5846

Your code is correct. The default feign Logger is misleading. http://beacon/.. that you see in the log isn't indicative of actual url that is being called. The actual request is resolved with https://beacon.org/...

Upvotes: 1

Related Questions