I am trying to call a `zuul` enabled server through `RestTemplate` by directly giving the URL.
For example: restTemplate.getForObject("<http://localhost:8090/emp-api>", Employee[].class);

But it is giving an error to me:

> 
> java.lang.IllegalStateException: No instances available for localhost
>  at org.springframework.cloud.netflix.ribbon.RibbonLoadBalancerClient.execute(RibbonLoadBalancerClient.java:90) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
> 
> 
> 

**Question in detail** :
I am having four projects (Github link (branch-master): <https://github.com/vickygupta0017/microservice-poc>)

1. microservice-server (eureka-server) port:8080
2. microservice-producer (Rest-api) port:8086
3. zuul-gatewayproxy (zuul-server) port:8090
4. microservice-consumer (spring-mvc) port:8087

[![Flow Image](https://i.stack.imgur.com/Gg1hF.jpg)](https://i.stack.imgur.com/Gg1hF.jpg)

If I am calling `zuul server` directly from browser("<http://localhost:8090/emp-api>), then it is redirecting the request to producer successfully.
But if I am calling this URL from the consumer through `RestTemplate` then it is giving me this error.

**For Information :** If I am not using zuul sever then I am able to call 'microservice-producer' from 'microservice-consumer' using `RestTemplate` successfully.