Skip to content

Commit

Permalink
fix:Fix init of ServiceMapping when metadata center uses nacos. (#1148
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wuwen5 authored Aug 25, 2023
1 parent 6328415 commit 77683ba
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.dubbo.admin.registry.config.GovernanceConfiguration;
import org.apache.dubbo.admin.registry.mapping.AdminMappingListener;
import org.apache.dubbo.admin.registry.mapping.ServiceMapping;
import org.apache.dubbo.admin.registry.mapping.impl.NacosServiceMapping;
import org.apache.dubbo.admin.registry.mapping.impl.NoOpServiceMapping;
import org.apache.dubbo.admin.registry.metadata.MetaDataCollector;
import org.apache.dubbo.admin.service.impl.InstanceRegistryCache;
Expand Down Expand Up @@ -203,7 +204,11 @@ ServiceMapping getServiceMapping(ServiceDiscovery serviceDiscovery, InstanceRegi
MappingListener mappingListener = new AdminMappingListener(serviceDiscovery, instanceRegistryCache);
serviceMapping = ExtensionLoader.getExtensionLoader(ServiceMapping.class).getExtension(metadataUrl.getProtocol());
serviceMapping.addMappingListener(mappingListener);
serviceMapping.init(metadataUrl);
if (serviceMapping instanceof NacosServiceMapping) {
serviceMapping.init(registryUrl);
} else {
serviceMapping.init(metadataUrl);
}
return serviceMapping;
}

Expand Down

0 comments on commit 77683ba

Please sign in to comment.