annotation @RibbonClient not work together with RestTemplate
<p>I am trying Ribbon configuration with RestTemplate based on <a href="https://github.com/livelessons-spring/building-microservices/blob/master/livelessons-choreography/livelessons-choreography-bookmark-service/src/main/java/demo/BookmarkServiceApplication.java" rel="nofollow">bookmark service example</a> but without luck, here is my code:</p>

<pre><code>@SpringBootApplication
@RestController
@RibbonClient(name = "foo", configuration = SampleRibbonConfiguration.class)
public class BookmarkServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(BookmarkServiceApplication.class, args);
    }

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("/hello")
    public String hello() {
        String greeting = this.restTemplate.getForObject("http://foo/hello", String.class);
        return String.format("%s, %s!", greeting);
    }
}
</code></pre>

<p>with error page as below:</p>

<pre><code>Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Tue Mar 22 19:59:33 GMT+08:00 2016
There was an unexpected error (type=Internal Server Error, status=500).
No instances available for foo
</code></pre>

<p>but if I remove annotation @RibbonClient, everything will be just ok,</p>

<pre><code>@RibbonClient(name = "foo", configuration = SampleRibbonConfiguration.class)
</code></pre>

<p>and here is SampleRibbonConfiguration implementation:</p>

<pre><code>public class SampleRibbonConfiguration {

  @Autowired
  IClientConfig ribbonClientConfig;

  @Bean
  public IPing ribbonPing(IClientConfig config) {
    return new PingUrl();
  }

  @Bean
  public IRule ribbonRule(IClientConfig config) {
    return new AvailabilityFilteringRule();
  }
}
</code></pre>

<p>Is it because RibbonClient can not work with RestTemplate together?</p>

<p>and another question is that does Ribbon configuration like load balancing rule could be configured via application.yml configuration file?
as from <a href="https://github.com/Netflix/ribbon/wiki/Working-with-load-balancers" rel="nofollow">Ribbon wiki</a>, seems we can configure Ribbon parameters like NFLoadBalancerClassName, NFLoadBalancerRuleClassName etc in property file, does Spring Cloud also supports this?</p>