title: Providing URL for @FeignClient by service name in application.properties without load balancer
body: <p>I want to use Feign client and provide URL in <code>application.properties</code> by service name.</p>
  <h3>Prerequisites:</h3>
  <p>I use Spring Boot and I have dependency to Feign from Spring Cloud:</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
      &lt;artifactId&gt;spring-cloud-starter-openfeign&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>I enabled Feign clients:</p>
  <pre><code>@SpringBootApplication
  @EnableFeignClients
  public class MyApplication {
      public static void main(String[] args) { SpringApplication.run(MyApplication.class, args); }
  }
  </code></pre>
  <h1>Attempts:</h1>
  <h3>1. Hardcoded URL in code</h3>
  <p>I know how to hardcore URL in code:</p>
  <pre><code>@FeignClient(name = &quot;some-service&quot;, url = &quot;http://some-service.com/&quot;)
  public interface SomeServiceClient {}
  </code></pre>
  <p>But I want to use properties file.</p>
  <h3>2. Hardcoded property</h3>
  <p>I know how to hardcode property to read URL from properties:</p>
  <pre><code>@FeignClient(name = &quot;some-service&quot;, url = &quot;${some-service.url}&quot;)
  public interface SomeServiceClient {}
  </code></pre>
  <p><code>application.properties</code>:</p>
  <pre><code>some-service.url=http://some-service.com/
  </code></pre>
  <p>It's a far better, but I want to decouple property name from Feign client. I would like to use only <code>name</code>.</p>
  <h2>3. Ribbon with load balancer</h2>
  <p>I know that Spring Cloud provides Ribbon when I can specify list of URLs (by Feign client name) for Ribbon's load balancer.</p>
  <pre><code>@FeignClient(name = &quot;some-service&quot;)
  public interface SomeServiceClient {}
  </code></pre>
  <p><code>application.properties</code>:</p>
  <pre><code>some-service.ribbon.listOfServers=http://some-service.com/
  ribbon.eureka.enabled=false
  </code></pre>
  <p><sup>Notice: I have to disable Eureka (which is enabled for default) because I don't need Eureka server. I need to provide URL in <code>application.properties</code> in my application.</sup></p>
  <p>Dependency:</p>
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
      &lt;artifactId&gt;spring-cloud-starter-netflix-ribbon&lt;/artifactId&gt;
  &lt;/dependency&gt;
  </code></pre>
  <p>This solution seems better because my Feign client in code contains only <code>name</code> (without URL or coupled property name for URL). That's exactly what I wanted to get.</p>
  <p>But in logs I see that Spring/Ribbon runs load balancer for me:</p>
  <pre><code>2020-11-03 23:39:01.832  INFO 12168 --- [nio-8080-exec-2] c.netflix.config.ChainedDynamicProperty  : Flipping property: some-service.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
  2020-11-03 23:39:01.892  INFO 12168 --- [nio-8080-exec-2] c.netflix.loadbalancer.BaseLoadBalancer  : Client: some-service instantiated a LoadBalancer: DynamicServerListLoadBalancer:{NFLoadBalancer:name=some-service,current list of Servers=[],Load balancer stats=Zone stats: {},Server stats: []}ServerList:null
  2020-11-03 23:39:01.908  INFO 12168 --- [nio-8080-exec-2] c.n.l.DynamicServerListLoadBalancer      : Using serverListUpdater PollingServerListUpdater
  2020-11-03 23:39:01.955  INFO 12168 --- [nio-8080-exec-2] c.netflix.config.ChainedDynamicProperty  : Flipping property: some-service.ribbon.ActiveConnectionsLimit to use NEXT property: niws.loadbalancer.availabilityFilteringRule.activeConnectionsLimit = 2147483647
  2020-11-03 23:39:01.970  INFO 12168 --- [nio-8080-exec-2] c.n.l.DynamicServerListLoadBalancer      : DynamicServerListLoadBalancer for client some-service initialized: DynamicServerListLoadBalancer:{NFLoadBalancer:name=some-service,current list of Servers=[jsonplaceholder.typicode.com:443],Load balancer stats=Zone stats: {unknown=[Zone:unknown;  Instance count:1;   Active connections count: 0;    Circuit breaker tripped count: 0;   Active connections per server: 0.0;]
  },Server stats: [[Server:jsonplaceholder.typicode.com:443;  Zone:UNKNOWN;   Total Requests:0;   Successive connection failure:0;    Total blackout seconds:0;   Last connection made:Thu Jan 01 01:00:00 CET 1970;  First connection made: Thu Jan 01 01:00:00 CET 1970;    Active Connections:0;   total failure count in last (1000) msecs:0; average resp time:0.0;  90 percentile resp time:0.0;    95 percentile resp time:0.0;    min resp time:0.0;  max resp time:0.0;  stddev resp time:0.0]
  ]}ServerList:com.netflix.loadbalancer.ConfigurationBasedServerList@6a4bfe52
  </code></pre>
  <p>I don't need load balancer (I have only one URL). How to disable it and always get first of <code>listOfServers</code>? Maybe there's a way to provide custom implementation of load balancer? Or at least disable logs for redundant load balancer?</p>
  <p>Or how to configure one URL for service name in other way?</p>
  <p>I read documentation but I didn't find solution:</p>
  <ul>
  <li><a href="https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html" rel="nofollow noreferrer">https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-feign.html</a></li>
  <li><a href="https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-ribbon.html" rel="nofollow noreferrer">https://cloud.spring.io/spring-cloud-netflix/multi/multi_spring-cloud-ribbon.html</a></li>
  </ul>