Is your feature request related to a problem? Please describe.
spring-cloud-openfeign-core:2.2.5.RELEASE
When I use a dynamic URL, like this:
@FeignClient(name = "dynamic")
interface DynamicClient {
@RequestLine("GET /")
String get(URI uri);
}
I will get an exception message:
Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: github.com
at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:483)
Describe the solution you'd like More friendly tips.
Describe alternatives you've considered
Internally provide a constant for the empty URL:
@FeignClient(name = "dynamic", url = FeignUtils.EMPTY_CLIENT, configuration = FooConfiguration.class)
interface DynamicClient {
@RequestLine("GET /")
String get(URI uri);
}
Also, add a comment for url()
/**
* @return an absolute URL or resolvable hostname (the protocol is optional).
* If you are using {@link java.net.URI}, configure the value to {@link FeignUtils#EMPTY_CLIENT}
*/
String url() default "";
Comment From: OlgaMaciaszek
Hello @crossoverJie; the 2.2.x branch is no longer supported. The test you've provided does not reproduce a valid use-case. Please verify if there's an issue on one of the supported versions (branch 3.1.x or main). If yes, please provide a minimal, complete, verifiable example that reproduces the issue.
Comment From: spring-cloud-issues
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.