alibaba / alibaba/spring-cloud-alibaba

Whether contain spring-cloud-loadbalancer dependency in nacos-discovery module

Open
#3,115 3 comments 1 reaction 0 assignees View on GitHub
good first issue kind/discussion
Dominant language
Java
Stars
29.2k
Forks
8.5k
Avg merge
1d 23h
Merged PRs (30d)
12

Description

**Which Component**
eg. Nacos Discovery

**Describe what problem you have encountered**
In relevant versions of `spring-cloud-starter-alibaba-nacos-discovery` from branch of 2.2.x, we add following dependency in it.
```xml

org.springframework.cloud
spring-cloud-starter-netflix-ribbon

```
For outside user, they just need to add `spring-cloud-starter-alibaba-nacos-discovery`, then can call downstream service directly.
But in relevant versions of `spring-cloud-starter-alibaba-nacos-discovery` from branch of 2021.x, Spring Cloud remove Ribbon from 2020.0.0, we did some adjustments, we use following loadbalancer module replacing `Ribbon`:
```xml

org.springframework.cloud
spring-cloud-loadbalancer
true

```
This piece is consistent with `spring-cloud-netflix-eureka-client`. Because of the optional attribute set to `true`, users need to add `spring-cloud-starter-alibaba-nacos-discovery` in addition to adding `spring-cloud-loadbalancer` to new applications manually. Otherwise the application cannot normally consume services. Setting the optional attribute to `true` in `spring-cloud-starter-alibaba-nacos-discovery` has the following benefits:
1. Reduce the size of the `spring-cloud-starter-alibaba-nacos-discovery` dependency report. If the application is not a consumer, it does not need to add redundant `spring-cloud-loadbalancer` dependencies.
2. Let the user clearly know what load balancing component he/she is using.
### shortcoming:
1. The threshold for application construction has been raised. For beginners of Spring Cloud, it is easy to forget the `spring-cloud-loadbalancer` dependency for the first time.

Some users suggested that the community remove optional attributes from subsequent versions in branch of 2021.x, so that they no longer need to manually add `spring-cloud-loadbalancer` dependencies. What do you think?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the dependency declarations in the spring-cloud-starter-alibaba-nacos-discovery module and compare them with the spring-cloud-netflix-eureka-client arrangement described in the issue. Review the 2021.x dependency report and the three comments, then document or implement a decided policy for the spring-cloud-loadbalancer optional attribute so consumer setup and non-consumer dependencies match that decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, cloud
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.