title: Spring Cloud Netflix Feign not working correcly
body: <p>Trying to use Feign Client with Eureka and Ribbon-</p>
  
  <p>Have a service registered using Eureka with name-test-service.</p>
  
  <p>Was able to use Ribbon and Eureka successfully as follows-</p>
  
  <pre><code>@Autowired
  private LoadBalancerClient loadBalancer;
  
  public void getEmployee() throws RestClientException, IOException {
  
      ServiceInstance serviceInstance=loadBalancer.choose("test-service");
  
      String baseUrl=serviceInstance.getUri().toString();
  
      baseUrl=baseUrl+"/test";
  
      RestTemplate restTemplate = new RestTemplate();
      ResponseEntity&lt;String&gt; response=null;
      try{
          response=restTemplate.exchange(baseUrl,
                  HttpMethod.GET, getHeaders(),String.class);
  
          }
  </code></pre>
  
  <p>This works correctly including load balancing.</p>
  
  <p>Now tried to replace RestTemplate with Feign as follows-</p>
  
  <pre><code>@FeignClient(name="test-service")
  public interface RemoteCallService {
      @RequestMapping(method=RequestMethod.GET, value="/test")
      public String resp();
  
  }
  </code></pre>
  
  <p>And making the call with feign as follows-</p>
  
  <pre><code>@Autowired
      private RemoteCallService loadBalancer;
  
      public void getEmployee() throws RestClientException, IOException {
  
          String data=loadBalancer.resp();
  
          }
  </code></pre>
  
  <p>But this is not working. The Feign URL is not getting formed correctly.
  On debugging the FeignClient has the following values-</p>
  
  <p>HardCodedTarget(type=RemoteCallService, name=test-service, <strong>url=<a href="http://test-service" rel="nofollow noreferrer">http://test-service</a></strong>)</p>
  
  <p>Can anyone tell what am i missing.</p>
  
  <p>Thanks</p>