title: Spring Boot health-based load balancing
body: <p>I'm using Spring Boot for microservices, and I came accross and issue with load balancing.</p>
  
  <p>Spring Actuator adds special <code>health</code> and <code>metrics</code> endpoint to the apps; with this, some basic information can be acquired from the running instances.</p>
  
  <p>What I would like to do, is to a create a (reverse)proxy (e.g. with Zuul and/or Ribbon?), which creates a centralized load balancer, that selects instances by their health status.</p>
  
  <p>For example, I have the following microservices</p>
  
  <ul>
  <li><code>client</code></li>
  <li><code>proxy</code> (&lt;- I would like to implement this)</li>
  <li><code>server 1</code></li>
  <li><code>server 2</code></li>
  </ul>
  
  <p>When the client sends an http request to the proxy, the proxy should be able to decide, which of the to server instances has the least load, and forward request to that one.</p>
  
  <p>Is there an easy way to do this?</p>
  
  <p>Thanks,
  krisy</p>