apache / apache/dubbo

com.alibaba cluster、Directory兼容失败

Open
#6,026 4 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

- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.

### Environment

* Dubbo version: 2.7.4.1
* Operating System version: mac
* Java version: 8

### Steps to reproduce this issue

1、Cluster
```java
@Deprecated
public interface Cluster extends org.apache.dubbo.rpc.cluster.Cluster {

com.alibaba.dubbo.rpc.Invoker join(com.alibaba.dubbo.rpc.cluster.Directory directory) throws
com.alibaba.dubbo.rpc.RpcException;

@Override
default Invoker join(Directory directory) throws RpcException {
return null;
}
}
```
> join为什么返回NULL

2、Directory
```java
public interface Directory extends org.apache.dubbo.rpc.cluster.Directory {

@Override
URL getUrl();

List> list(com.alibaba.dubbo.rpc.Invocation invocation) throws com.alibaba.dubbo.rpc.RpcException;

@Override
default List> list(Invocation invocation) throws RpcException {
List> res = this.list(new com.alibaba.dubbo.rpc.Invocation.CompatibleInvocation(invocation));
return res.stream().map(i -> i.getOriginal()).collect(Collectors.toList());
}
}
```
> 缺少兼容Directory,例如`CompatibleDirectory`

我们有老项目实现了Cluster,如果改新的包,很多项目都要动,量很大,所以需要兼容老的。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.