How to create Client Load Balancing with Spring Cloud Ribbon + Spring Boot

https://grokonez.com/spring-framework/spring-cloud/create-client-load-balancing-spring-cloud-ribbon-spring-boot

How to create Client Load Balancing with Spring Cloud Ribbon + Spring Boot

In the tutorial, JavaSampleApproach will show you the steps of creating a Client Load Balancing with Spring Cloud Ribbon.

Related articles:

I. Technologies

– Java 1.8
– Maven 3.3.9
– Spring Tool Suite – Version 3.8.1.RELEASE
– Spring Boot: 1.5.1.RELEASE

II. Load Balancer

1. Proxy Load Balancer

spring cloud ribbon - proxy load balancer

Advantage & Disadvantage:

  • Centralized Load Balancing
  • Can be bottle neck
  • Single point of failure

    2. Client Load Balancer

    Spring Cloud Ribbon is a solution for Client Load Balancing.

spring cloud ribbon - ribbon load balancer

Advantage & Disadvantage:

  • Decentralized Load Balancing
  • No bottle neck
  • Resilent
  • Data can be inconsistent

    III. Practice

    Create 2 projects:
  • a Spring Boot project for simple restful services, running at addresses: {localhost:8090,localhost:8091,localhost:8092}
  • a Spring Boot project for Load Balancing - Ribbon Client, running at address: localhost:8080

Step to do:

  • Create Spring Boot project for simple Restful service
  • Create Spring Boot project for Ribbon client
  • Config Ribbon client
  • Create a Load Balancing Rest controller
  • Run & check results

    1. Create Spring Boot project for simple Restful service

  • Using SpringToolSuite, create a SpringBoot project. Then add web dependency:

    
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
  • Create a simple RestController with 2 requestmappings:

More at:

https://grokonez.com/spring-framework/spring-cloud/create-client-load-balancing-spring-cloud-ribbon-spring-boot

How to create Client Load Balancing with Spring Cloud Ribbon + Spring Boot

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

Male avatar

loveprogramming

448 bài viết.
78 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
Male avatar
1 0
Tutorial Link: (Link) (Ảnh) Django is a Pythonbased free and opensource web framework that follows the modeltemplateview architectural pattern. A...
loveprogramming viết 6 tháng trước
1 0
Male avatar
1 0
https://loizenai.com/angular11nodejspostgresqlcrudexample/ Angular 11 Node.js PostgreSQL Crud Example (Ảnh) Tutorial: “Angular 11 Node.js Postg...
loveprogramming viết 5 tháng trước
1 0
Male avatar
1 0
Angular Spring Boot jwt Authentication Example Github https://loizenai.com/angularspringbootjwt/ (Ảnh) Tutorial: ” Angular Spring Boot jwt Authe...
loveprogramming viết 5 tháng trước
1 0
Bài viết liên quan
Male avatar
0 0
https://grokonez.com/frontend/angular/angular6/kotlinspringbootangular6crudhttpclientmysqlexamplespringdatajparestapisexample Kotlin Spring Boot +...
loveprogramming viết 1 tháng trước
0 0
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


Male avatar
{{userFollowed ? 'Following' : 'Follow'}}
448 bài viết.
78 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!