You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "xwq111222 (via GitHub)" <gi...@apache.org> on 2023/06/28 08:17:09 UTC

[GitHub] [dubbo] xwq111222 opened a new issue, #12609: 关于GenericService 泛化调用多个接口实现类应该如何指定接口是实现类的问题

xwq111222 opened a new issue, #12609:
URL: https://github.com/apache/dubbo/issues/12609

   测试环境:
   jdk:18
   dubbo:2.7.5
   这是我的方法:
     public GenericService getGenericService(String serverName, Class<?> clazz) {
           ApplicationConfig application = new ApplicationConfig();
           ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
           application.setName(serverName);
           // 弱类型接口名
           reference.setInterface(clazz);
           RegistryConfig registry = new RegistryConfig();
           registry.setAddress(dubboConfig.getRegistryAddress());
           // 注册
           application.setRegistry(registry);
           // 声明为泛化接口
           reference.setGeneric("true");
           reference.setApplication(application);
           return reference.get();
     }
   问题:clazz有多个实现类,想通过application指定对应的接口实现类,但是失效,请问应该怎么调用指定的接口实现类


-- 
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: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] 关于GenericService 泛化调用 接口有多个接口实现类 应该如何指定接口实现类的问题 [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ closed issue #12609: 关于GenericService 泛化调用 接口有多个接口实现类     应该如何指定接口实现类的问题
URL: https://github.com/apache/dubbo/issues/12609


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12609: 关于GenericService 泛化调用 接口有多个接口实现类 应该如何指定接口实现类的问题

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12609:
URL: https://github.com/apache/dubbo/issues/12609#issuecomment-1611337969

   > 想通过application指定对应的接口实现类,但是失效
   
   没懂是什么意思
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] xwq111222 commented on issue #12609: 关于GenericService 泛化调用 接口有多个接口实现类 应该如何指定接口实现类的问题

Posted by "xwq111222 (via GitHub)" <gi...@apache.org>.
xwq111222 commented on issue #12609:
URL: https://github.com/apache/dubbo/issues/12609#issuecomment-1614029467

   有多个消费者,可以通过什么来指定消费者


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] xwq111222 commented on issue #12609: 关于GenericService 泛化调用 接口有多个接口实现类 应该如何指定接口实现类的问题

Posted by "xwq111222 (via GitHub)" <gi...@apache.org>.
xwq111222 commented on issue #12609:
URL: https://github.com/apache/dubbo/issues/12609#issuecomment-1619327609

   好的明白了谢谢


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12609: 关于GenericService 泛化调用 接口有多个接口实现类 应该如何指定接口实现类的问题

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12609:
URL: https://github.com/apache/dubbo/issues/12609#issuecomment-1617121844

   Dubbo 服务调用只会按照 接口 + 版本号 + 分组 去唯一区分服务


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #12609: 关于GenericService 泛化调用 接口有多个接口实现类 应该如何指定接口实现类的问题

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #12609:
URL: https://github.com/apache/dubbo/issues/12609#issuecomment-1617121644

   ApplicationConfig 和调用是没有关系的呀


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org