先把configuration注掉

我们原来是通过url的形式访问的

把URL也注掉,这样就变成了一个没有访问目标的

重启consumer服务,肯定是无法访问的

http://localhost:7201/sayhello/feign?message=111

ERROR (DirectJDKLog.java:175)- Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: com.netflix.client.ClientException: Load balancer does not have available server for client: providerTest] with root cause
com.netflix.client.ClientException: Load balancer does not have available server for client: providerTest

改成eureka里面注册的服务名

重启服务测试

http://localhost:7201/sayhello/feign?message=111

演示负载均衡

复制Provider的


和我们的配置文件对应起来

这里也改成pro-02 然后点击Apply

选择并启动

等服务注册到eureka。 可能会稍微的等一会。


这里之前配置的是轮询的方式

结束

相关文章:

  • 2021-06-12
  • 2021-08-30
  • 2021-09-20
  • 2022-02-08
  • 2021-10-14
  • 2021-12-17
  • 2021-08-18
  • 2021-11-10
猜你喜欢
  • 2021-11-14
  • 2021-05-11
  • 2021-05-24
  • 2021-05-20
  • 2022-01-08
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案