Ribbon retries Configuration of multiple microservices

Source: Internet
Author: User

Add the node for the microservices that you want to retry with the current application properties file Zuul also go in.

How many services are configured to retry.

Consider doing a batch from the class to see the source TODO

1. About 3 Zuul break 2 Zuul, and then a partial failure to access the service provider interface occurs because the
caller has not joined the retry configuration of the Zuul.

Spring.cloud.loadbalancer.retry.enabled=true
#建立连接超时时间
horus-zuul-server.ribbon.connecttimeout=250
#连接超时时间
horus-zuul-server.ribbon.readtimeout=10000
#所有操作都重试
Horus-zuul-server.ribbon.oktoretryonalloperations=true
#重试发生, change the maximum
number of nodes Horus-zuul-server.ribbon.maxautoretriesnextserver=6
#单个节点重试最大值
Horus-zuul-server.ribbon.maxautoretries=1

2 shuts down two for three service providers, and there is a case

 of failure using the caller's direct access to the service provider Because the Maxautoretriesnextserver is set to 1 and the failed node has to be transferred multiple times, this parameter should be set larger.
Note: Client-ribbon is a service provider name

spring.cloud.loadbalancer.retry.enabled=true
#建立连接超时时间
client-ribbon.ribbon.connecttimeout=250
#连接超时时间
client-ribbon.ribbon.readtimeout=10000
#所有操作都重试
client-ribbon.ribbon.oktoretryonalloperations=true
#重试发生, change the maximum
number of nodes Client-ribbon.ribbon.maxautoretriesnextserver=6
#单个节点重试最大值
Client-ribbon.ribbon.maxautoretries=1
Pom file Add it yourself

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.