You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice the url is resolved from a property. It also isn't to uncommon to have a configuration which resolves the property to the value of an environment variable:
my:
url: ${MY_URL}
Now if MY_URL is defined as the empty string, you get this error message:
No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-loadbalancer?
Which is very misleading... when the real issue is that no url was defined. I'd suggest changing this line of code:
It would definitely have helped me out. To work around this issue, I've been adding custom conditional annotations which disable my feign client if the url property is missing or null (since @ConditionalOnProperty will trigger even if it is an empty string).
The text was updated successfully, but these errors were encountered:
Describe the bug
A common scenario is to define a
@FeignClient
as such:Notice the
url
is resolved from a property. It also isn't to uncommon to have a configuration which resolves the property to the value of an environment variable:Now if
MY_URL
is defined as the empty string, you get this error message:Which is very misleading... when the real issue is that no
url
was defined. I'd suggest changing this line of code:spring-cloud-openfeign/spring-cloud-openfeign-core/src/main/java/org/springframework/cloud/openfeign/FeignClientFactoryBean.java
Line 352 in 33f3841
To be:
It would definitely have helped me out. To work around this issue, I've been adding custom conditional annotations which disable my feign client if the url property is missing or null (since
@ConditionalOnProperty
will trigger even if it is an empty string).The text was updated successfully, but these errors were encountered: