Ribbon
Ribbon is based on a client's HTTP and TCP load balancer which can be configured ribbonServerList (list server) on the client, then a polling request to achieve load balancing ribbonServerList it will be overwritten when used in the combination DiscoveryEnabledNIWSServerList Eureka, extended to the Eureka registration Center for the server list and it will be replaced with NIWSDiscoveryPing iPing, it duties entrusted to Eureka to determine whether the services have been started.
Feign
Note: spring-cloud-starter-feign which already contains a spring-cloud-starter-ribbon (Feign also used in the Ribbon)
ribbon and feign two differences and choose
-
Select feign
-
The default integrated ribbon
-
To write more clear thinking and convenient
-
Annotations using configuration mode, configuration to facilitate fusing, etc.
-
-
In the product-service classes, was added
try { TimeUnit.SECONDS.sleep(2); } catch (InterruptedException e) { e.printStackTrace(); }
Will this happen:
Cause: By default optons readtimeout is 60, but because hystrix default is 1 second timeout.
Solution :
# Modify call timeout
#ribbon timeout
Ribbon