title: Spring Cloud API Gateway routing not working
body: <p>I have designed a micro service prototype using below technologies</p>
  <ol>
  <li><strong>Eureka Server</strong></li>
  <li><strong>a service</strong></li>
  <li><strong>Spring Cloud API Gateway</strong></li>
  </ol>
  <p>Above mentioned service are registered in the Eureka Server</p>
  <p><a href="https://i.stack.imgur.com/N3WNm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N3WNm.png" alt="enter image description here" /></a></p>
  <p><strong>API Gateway routing Configuration</strong></p>
  <pre><code>server.port=8080
  eureka.client.serviceUrl.defaultZone = http://localhost:8083/eureka
  spring.application.name=ApiGateway
  spring.cloud.gateway.discovery.locator.enabled=true
  spring.cloud.gateway.discovery.locator.lower-case-service-id=true
  
  spring.cloud.gateway.routes[0].id=service1
  spring.cloud.gateway.routes[0].uri=lb://MICROSERVICE1
  spring.cloud.gateway.routes[0].predicates[0]=Path=/service1/**
  </code></pre>
  <p><strong>The service Configuration</strong></p>
  <pre><code>server.port=8081
  server.address=127.0.0.1
  eureka.client.serviceUrl.defaultZone = http://localhost:8083/eureka
  spring.application.name=MicroService1
  error.whitelabel.enabled= false
  </code></pre>
  <p><strong>Controller</strong></p>
  <pre><code>@RestController
  @RequestMapping(&quot;/service1&quot;)
  public class HomeController {
      @GetMapping(&quot;/message&quot;)
      public String hello() {
          return &quot;response from micro service1&quot;;
      }
  
  }
  </code></pre>
  <p>When I send a request to the gateway it's showing the below error</p>
  <pre><code>2020-12-16 22:26:09.770 ERROR 16700 --- [ctor-http-nio-3] a.w.r.e.AbstractErrorWebExceptionHandler : [d3334561-1]  500 Server Error for HTTP GET &quot;/service1/message&quot;
  
  java.net.UnknownHostException: failed to resolve 'LAPTOP-KU56B6A8' after 3 queries 
      at io.netty.resolver.dns.DnsResolveContext.finishResolve(DnsResolveContext.java:1013) ~[netty-resolver-dns-4.1.55.Final.jar:4.1.55.Final]
      Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
  Error has been observed at the following site(s):
      |_ checkpoint ⇢ org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter [DefaultWebFilterChain]
      |_ checkpoint ⇢ HTTP GET &quot;/service1/message&quot; [ExceptionHandlingWebHandler]
  </code></pre>
  <p>How can we solve the above issue?</p>