This article is about SpringCloud in action (ribbon+restTemplate). To follow the ribbon, click on portal:
SpringCloud In action (I) – Highly available Service Registry (Eureka)
We introduced the high availability Eureka cluster construction. In the microservices architecture, the business is split into a separate service, and the communication between services is based on HTTP restful. Spring Cloud has two service invocation methods, ribbon+restTemplate and Feign. In this article, we will first introduce ribbon+restTemplate.
Introduction to the Ribbon
Spring Cloud Ribbon is a client load balancing tool based on HTTP and TCP, which is implemented by Netflix Ribbon. Spring Cloud’s package makes it easy to automatically convert service-oriented REST template requests into client load balancing service calls. It includes a load balancing framework, supports pluggable load balancing rules, supports multiple protocols, such as HTTP, UDP, and provides load balancing clients.
Feign, which we will introduce later, is also a tool based on the Ribbon implementation.
Second, preparation
We need to start the Eureka server cluster based on the Eureka server in the previous article