Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DubboAdmin支持Dubbo3+Nacos做如下变更是否合适 #952

Open
liudaac opened this issue Dec 23, 2022 · 1 comment
Open

DubboAdmin支持Dubbo3+Nacos做如下变更是否合适 #952

liudaac opened this issue Dec 23, 2022 · 1 comment

Comments

@liudaac
Copy link

liudaac commented Dec 23, 2022

Environment

  • Dubbo Admin version: 0.5.0
  • Java version: 1.8
  • Nacos: 2.1.0

Steps to reproduce this issue

  1. 集成Dubbo3.x应用发现问题

NacosServiceMapping的初始化逻辑注入Url为metadataUrl,参考代码ConfigServer.getServiceMapping(ServiceDiscovery serviceDiscovery, InstanceRegistryCache instanceRegistryCache)
而目前按照Dubbo的处理逻辑,metadataUrl的group默认值为dubbo、registryUrl的group默认值为DEFAULT_GROUP,即存在metadataUrl与registryUrl不一致的情况,此时NacosServiceMapping使用metadataUrl初始化则导致getAllServiceNames()结果为空,现象为管理界面服务列表为空,此处应该修改为使用registryUrl进行初始化,才能使服务列表正常获取和显示,参考如下

@Bean
    @DependsOn("dubboRegistry")
    ServiceMapping getServiceMapping(ServiceDiscovery serviceDiscovery, InstanceRegistryCache instanceRegistryCache) {
        ServiceMapping serviceMapping = new NoOpServiceMapping();
        if (registryUrl == null) {
            return serviceMapping;
        }
        MappingListener mappingListener = new AdminMappingListener(serviceDiscovery, instanceRegistryCache);
        serviceMapping = ExtensionLoader.getExtensionLoader(ServiceMapping.class).getExtension(registryUrl.getProtocol());
        serviceMapping.addMappingListener(mappingListener);
        serviceMapping.init(registryUrl);
        return serviceMapping;
    }
@liudaac liudaac changed the title DubboAdmin支持Dubbo3+Nacos需要如下变更 DubboAdmin支持Dubbo3+Nacos做如下变更是否合适 Dec 23, 2022
@wuwen5
Copy link
Contributor

wuwen5 commented Jun 1, 2023

#1148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants