Getting exception: ReactiveException: java.net.UnknownHostException: No such host is known zuul Eurka webclient

Viewed 110

I have heard that this should work I have a zuul routing

zuul 
    throttling:
      path: "/throttling/**"
      serviceId: "SITE-THROTTLING"
      stripPrefix: false

I have a micro service registered as a Eueka client

SITE-THROTTLING n/a (1) (1) UP (1) - 10.100.1.125:site-throttling:8084

Now I need to call this via a filter its not the usual routing pattern site.

@Autowired
    WebClient webClient;
    
    private static final String authenticationServiceId = "http://SITE-THROTTLING";

    @Override
    public boolean sendPost(String url) {
        log.info("THROTTLE URL "+url);
        WebClient webClient = WebClient.create();
        Boolean flag = webClient.put()
                                       .uri(authenticationServiceId+ "/throttle")
                                       .bodyValue(url)
                                       .retrieve()
                                       .bodyToMono(Boolean.class)
                                       .block();
        return flag;
    }

But I am getting the following UnknownHostException: No such host is known (SITE-THROTTLING) I was hoping that the webclient would resolve the service id. But it seems to see SITE-THROTTLING as the host rather than treating it as a service Id, is there a way round this.

0 Answers
Related