基于SpringCloudAlibaba和Nacos微服务体系下的FeignClient客户端负载均衡入门实例
本文主要介绍在SpringCloudAlibaba和Nacos微服务框架下,使用openfeign的FeignClient实现客户端负载均衡的效果。关于服务提供者和服务消费者的程序请直接查阅这篇文章。 基于SpringCloudAlibaba和Nacos构建微服务入门实例 OpenFeign简介 Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket. Feign's first goal was reducing the complexity of binding Denominator uniformly to HTTP APIs regardless of ReSTfulness. 打包服务提供者程序 将 基于SpringCloudAlibaba和Nacos构建微服务入门实例 中的服务提供者程序打包输出:myclouds-nacos-discovery-provider-example-3.0.0.jar。 启动2个服务提供者实例 java -jar myclouds-nacos-discovery-provider-example-3.0.0.jar --server.port=18000 java -jar myclouds-nacos-discovery