apache / apache/dubbo

[Bug] When subscribing to the same service from multiple registry centers in Dubbo 3.3.4, subscription relationships are not handled correctly.

Open
#15,761 3 comments 0 reactions 0 assignees View on GitHub
help wanted
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

3.3.4

### Steps to reproduce this issue

For example: There's a service called com.a.b.QuotaService available in both registry centers "registrySt" and "registryOnline". Now I subscribe to them in my service like this:

@Reference(group = "", registry = "registrySt", interfaceClass = QuotaService.class, check = false, retries = 0, timeout = 3000)
private QuotaService quotaServiceSt;

@Reference(group = "", registry = "registryOnline", interfaceClass = QuotaService.class, check = false, retries = 0, timeout = 5000)
private QuotaService quotaServiceOnline;

During project initialization and subscription, it goes through a cache logic where the key obtained is "com.a.b.QuotaService" in both cases. This means the first one can initialize properly, but the second one reuses what's in the cache because the key is the same.

Image

Image

### What you expected to happen

However, for my use case, these two References should be independent and shouldn't be reused.

### Anything else

_No response_

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

- [ ] 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 from Java SDK initialization of the two @Reference declarations and trace the subscription cache logic that produces the shared service-interface key. Reproduce the case with the same service in registrySt and registryOnline, then verify that both references maintain independent subscription relationships with a regression test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.