Springcloud Spring Boot mybatis distributed micro-service Cloud Architecture-docker-feign-hystrix-ribbon (vii)

Source: Internet
Author: User

Brief introduction

In the previous section, we discussed feign+hystrix in the development of the project, in addition to considering the normal invocation, load balancing and failover is also the focus of attention, which is the advantage of feign + Ribbon+hystrix, In this section we discuss the use of the Ribbon in feign in two ways

One, through the configuration file application.yml configuration, open the Ribbon, and specify the call producer relative to the previous section can make no changes, Can see item (microservice-consumer-movie-feign-with-hystrix-hystrix-factory)

The project structure is as follows:

APPLICATION.YML configuration file:

Spring:application:name:microservice-consumer-movie-feign-with-hystrix-hystrix-Factoryserver:port:7901eureka:client:healthcheck:enabled:trueserviceUrl:defaultZone:http://Jacky:[email protected]:8761/eureka/,Http://jacky: [Email protected]:8762/eureka/,Http://jacky: [Email protected]:8763/eureka/Instance:prefer-ip-address:trueMicroservice-provider-User:ribbon:NFLoadBalancerRuleClassName:com.netflix.loadbalancer.RandomRulehystrix.command.default. execution.isolation.thread.timeoutinmilliseconds:5000

Second, by writing the configuration class, specify the Ribbon configuration class in the Startup class, you can see the project (Microservice-consumer-movie-ribbon)

The project structure is as follows:

Source source technical support for complete projects 1791743380

Springcloud Spring Boot mybatis distributed micro-service Cloud Architecture-docker-feign-hystrix-ribbon (vii)

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.