apache / apache/dubbo

对同一个服务注入了不同策略的两个Bean,请求接口时,警告consumers下NodeExists,有办法取消警告吗?

Open
#10,692 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

1. 配置不同策略的Bean(同一个服务)
```java
@Configuration
public class ReferenceConfiguration {

@Bean
@DubboReference(interfaceClass = IdGeneratorService.Iface.class, version = "1.0", timeout = 5000, cluster = "hint")
public ReferenceBean idGeneratorService1() {
return new ReferenceBean();
}

@Bean
@DubboReference(interfaceClass = IdGeneratorService.Iface.class, version = "1.0", timeout = 5000, cluster = ClusterRules.BROADCAST)
public ReferenceBean idGeneratorService2() {
return new ReferenceBean();
}

}
```

2. 注入Bean
``` java
@Autowired
private IdGeneratorService.Iface idGeneratorService1;//idGeneratorService1:hint模式,可以指定ip和port

@Autowired
private IdGeneratorService.Iface idGeneratorService2;//idGeneratorService2:广播模式

...
...

HintManager.setHint("192.168.0.81", 11251);
idGeneratorService1.getId(11);

idGeneratorService2.getId(1);
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the configuration in ReferenceConfiguration with the two ReferenceBean instances and the HintManager call shown. Start by tracing the consumers/NodeExists warning produced when both strategies target the same service, then verify whether the warning can be suppressed without changing either invocation's behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.