frlzk opened a new issue #8777:
URL: https://github.com/apache/dubbo/issues/8777


   - [ ] 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: 3.0.2.1
   * Operating System version: Ubuntu20
   * Java version: 1.8
   * nacos 2.0
   
   ### Steps to reproduce this issue
   
   一个接口4个实现,其中两个实现在consumer端,另两个在provider端。这4个实现属于不同的group
   `
   //接口定义
   public class Hello implements Serializable {
        private String name;
        public String getName() {
                return name;
        }
        public void setName(String name) {
                this.name = name;
        }
   }
   public interface HelloService {
        public List<Hello> hellos();
   }
   //使用接口的Controller
   @Controller
   public class HelloController {
        @DubboReference(group="*",merger="list" ) //scope="remote",
        HelloService service;
        
        @RequestMapping("/hellos")
        @ResponseBody
        public List<Hello> hellos() {
                return service.hellos();
        }
   }
   //消费端接口实现
   @DubboService(group="consumerHello1")
   public class Hello1ServiceImpl implements HelloService {
        public List<Hello> hellos(){
                List<Hello> res=new ArrayList();
                Hello hell=new Hello();
                hell.setName("consumer-hello-1");
                res.add(hell);
                return res;
        }
   }
   @DubboService(group="consumerHello2")
   public class Hello2ServiceImpl implements HelloService {
        public List<Hello> hellos(){
                List<Hello> res=new ArrayList();
                Hello hell=new Hello();
                hell.setName("consumer-hello-2");
                res.add(hell);
                return res;
        }
   }
   
   //服务端接口实现
   @DubboService(group="providerHello1")
   public class Hello1ServiceImpl implements HelloService {
   
        public List<Hello> hellos(){
                List<Hello> res=new ArrayList();
                Hello hell=new Hello();
                hell.setName("provider-hello-1");
                res.add(hell);
                return res;
        }
   }
   @DubboService(group="providerHello2")
   public class Hello2ServiceImpl implements HelloService {
        public List<Hello> hellos(){
                List<Hello> res=new ArrayList();
                Hello hell=new Hello();
                hell.setName("provider-hello-2");
                res.add(hell);
                return res;
        }
   }
   
   `
   
   ###运行结果和期望结果共7种情况,其中只有一个符合预期:
   1. 不设置scope参数:@DubboReference(group="*",merger="list")
   1.1 只启动consumer,调用HelloController
        结果:返回一条数据
        期望:返回两条数据
   1.2 先启动consumer,再启动provider,调用HelloController
        结果:返回一条数据
        期望:返回四条数据
   1.3 先启动provider,再启动consumer,调用HelloController
        结果:返回一条数据
        期望:返回四条数据
   2. 设置scope参数:@DubboReference(group="*",merger="list",scope="remote")
   2.1 只启动consumer,调用HelloController
        结果:返回一条数据
        期望:返回两条数据
   2.2  先启动consumer,再启动provider,调用HelloController
        结果:返回一条数据
        期望:返回四条数据
   2.3 先启动provider,再启动consumer,调用HelloController
        结果:返回四条数据
        期望:返回四条数据
   2.3 先启动provider,再启动consumer,调用HelloController,关闭provider,再次调用HelloController
        结果:org.apache.dubbo.rpc.RpcException: No provider available from 
registry 127.0.0.1:8848
        期望:返回两条数据
        


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to