title: Separate scalabilty concerns from services
body: <p>I use Spring RestTemplate to consume other services in my local environment.</p>
  
  <p>In production env for scalabilty i want to use a service registry like eureka and ribbon client.</p>
  
  <p>I want to have a clean separation of my code from eureka and ribbon client so that i can run my services locally without the overhead of running a separate service for eureka , registering the services with eureka and also doing a lookup against eureka during orchestration.</p>
  
  <p>I have used spring profile feature to  separate out the code and configuration related local and production.</p>
  
  <p>I am stuck at one point where I use RestTemplate to invoke other services.</p>
  
  <p>I want to use the load balanced rest template for prod env and normal rest template for local service call.</p>
  
  <p>I am having difficulty in injecting the type of RestTemplate based on my environment.</p>
  
  <p>Can someone help me with the right way of injecting the RestTemplate so that my services can run locally as well as leverage service registry and ribbon client when running in Prod env without impacting the code.</p>
  
  <p>Thanks,
  Sri</p>