apache / apache/dubbo

[Bug] Use Nacos as registry center, every diffrent registry.group eatablished it's own NamingService connection, that causes too many connections to be established

Open
#15,624 5 comments 0 reactions 0 assignees View on GitHub
help wanted type/enhancement
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

### Pre-check

- [x] I am sure that all the content I provide is in English.

### Search before asking

- [x] I had searched in the [issues](https://github.com/apache/dubbo/issues?q=is%3Aissue) and found no similar issues.

### Apache Dubbo Component

Java SDK (apache/dubbo)

### Dubbo Version

Dubbo Java 3.2.13, JDK 8, Mac OS/Linux

### Steps to reproduce this issue

In one Dubbo project use Nacos as registry center, there are several interfaces, and set different `registry.group` for each interface, that will established one connection to Nacos for each interface(registry.group), so it causes too many connections to be established.

I check the code in class `org.apache.dubbo.registry.nacos.NacosRegistryFactory`, in the method `createRegistry` will create a `NamingService` every time.

***Is it neccessary to create a new `NamingService` every time for each different `registry.group` ?***

some related code:

Image

Image

Image

### What you expected to happen

Establish only one NamingService Connection for each `Nacos Host`,not for each `registry.group`

### Anything else

_No response_

### Are you willing to submit a pull request to fix on your own?

- [x] Yes I am willing to submit a pull request on my own!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)

Contributor guide

Open the contributing guide

Research direction

Start at org.apache.dubbo.registry.nacos.NacosRegistryFactory#createRegistry and inspect the related Nacos registry code shown in the issue, comparing behavior across registry.group values. Reproduce the case with several interfaces and groups; done means one NamingService connection per Nacos host rather than one per registry.group, with relevant regression coverage if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.