You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/06/10 13:03:31 UTC

[GitHub] [dubbo] Molerni opened a new issue, #10138: 请问如何获取ServiceDiscovery实例?

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

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ## Ask your question here
   业务代码中需要获取ServiceDiscovery 来查询其他ServiceInstances 和 getLocalInstance。 获取读取指定携带得信息。
   有没有类似 SpringCloud 的方式注入 DiscoveryClient 就能获取到实例?
   


-- 
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


[GitHub] [dubbo] Molerni closed issue #10138: 请问如何获取ServiceDiscovery实例?

Posted by GitBox <gi...@apache.org>.
Molerni closed issue #10138: 请问如何获取ServiceDiscovery实例?
URL: https://github.com/apache/dubbo/issues/10138


-- 
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] Molerni commented on issue #10138: 请问如何获取ServiceDiscovery实例?

Posted by GitBox <gi...@apache.org>.
Molerni commented on issue #10138:
URL: https://github.com/apache/dubbo/issues/10138#issuecomment-1152888237

   看了一源码可以通过 
   1、ApplicationModel model = DubboBeanUtils.getApplicationModel(ApplicationContext);
   2、RegistryManager rm = RegistryManager.getInstance(model);
   3、List<ServiceDiscovery> sds = rm.getServiceDiscoveries();
   即可拿到 ServiceDiscovery , 不小的有没有更好的办法, 先关闭了。 


-- 
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