How to manually call a microservice from a JHIPSTER gateway repository or service
<p>I'm new to Jhipster, and wondering if it's possible to manually call a microservices from the gateway code using a RestTemplate or something else.</p>

<p>My first idea was to call the gateway itself... but I'm not sure it's a good idea. 
My second idea was to try and call the service by it's URL. My concern is that I don't want to hardcode the port of a given node. Instead, i want to use proper loadbalancing.</p>

<p>I've read this article <a href="https://dzone.com/articles/spring-cloud-rest-client-with-netflix-ribbon-basic" rel="nofollow">https://dzone.com/articles/spring-cloud-rest-client-with-netflix-ribbon-basic</a>, but the injection failed.</p>

<p>I've read somewhere else that you now need to manually add the bean declaration</p>

<pre><code>@LoadBalanced
@Bean
RestTemplate restTemplate(){
    return new RestTemplate();
}
</code></pre>

<p>But now I'm struggling with the actual URI : what I am supposed to put as the root? (xxxxx)</p>

<pre><code>final HcpVersionedhcp hcpVersionedhcp = 
            restTemplate.exchange("http://xxxxx/api/user-data/byLogin/", UserData.class);
</code></pre>

<p>The only configuration I have in my gateway application.yml is</p>

<pre><code>ribbon:
eureka:
    enabled: true
</code></pre>