1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

Merge remote-tracking branch 'up/master'

This commit is contained in:
theonefx 2021-04-23 10:56:13 +08:00
commit c9984f5880

View File

@ -308,6 +308,16 @@ public class DubboCloudRegistry extends FailbackRegistry {
String protocol = templateURL.getProtocol();
Integer port = repository.getDubboProtocolPort(serviceInstance,
protocol);
// reserve tag
String tag = null;
List<URL> urls = jsonUtils.toURLs(serviceInstance.getMetadata()
.get("dubbo.metadata-service.urls"));
if (urls != null && urls.size() > 0) {
Map<String, String> parameters = urls.get(0).getParameters();
tag = parameters.get("dubbo.tag");
}
if (Objects.equals(templateURL.getHost(), host)
&& Objects.equals(templateURL.getPort(), port)) { // use
// templateURL
@ -331,7 +341,8 @@ public class DubboCloudRegistry extends FailbackRegistry {
// the template
// URL
.setHost(host) // reset the host
.setPort(port); // reset the port
.setPort(port) // reset the port
.addParameter("dubbo.tag", tag); // reset the tag
return clonedURLBuilder.build();
}