We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
43页右下角的"hello"接口。这个案例讲的是使用ReactiveDsicoveryClient获取服务实例并切用WebClient这种reactive客户端调用服务,所以这里获取服务实例不应该通过DiscoveryClient而是通过ReactiveDsicoveryClient。并且这个类也不应该出现DiscoveryClient
deep-in-spring-cloud-samples/chapter02/spring-cloud-alibaba-nacos-consumer-reactive/src/main/java/deep/in/spring/cloud/NacosReactiveConsumer.java /
The text was updated successfully, but these errors were encountered:
@GetMapping("/hello") public Mono hello() { Flux instances = reactiveDiscoveryClient.getInstances(serviceName); // 从服务实例中取第一个 ServiceInstance serviceInstance = instances.blockFirst(); // 使用WebClient调用服务实例对应的节点信息中的“/echo”方法 return WebClient.create("http://" + serviceInstance.getHost() + ":" + serviceInstance.getPort()) .get() .uri("/echo?name=nacos") .retrieve() .bodyToMono(String.class); }
Sorry, something went wrong.
No branches or pull requests
43页右下角的"hello"接口。这个案例讲的是使用ReactiveDsicoveryClient获取服务实例并切用WebClient这种reactive客户端调用服务,所以这里获取服务实例不应该通过DiscoveryClient而是通过ReactiveDsicoveryClient。并且这个类也不应该出现DiscoveryClient
deep-in-spring-cloud-samples/chapter02/spring-cloud-alibaba-nacos-consumer-reactive/src/main/java/deep/in/spring/cloud/NacosReactiveConsumer.java /
The text was updated successfully, but these errors were encountered: