You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2022/12/25 13:07:07 UTC
[dubbo] branch 3.1 updated: Fix Spring Cloud metadata override (#11197)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.1 by this push:
new 0d02c79542 Fix Spring Cloud metadata override (#11197)
0d02c79542 is described below
commit 0d02c79542d934cc8bd6e972cffe7f7baeb594ca
Author: Albumen Kevin <jh...@gmail.com>
AuthorDate: Sun Dec 25 21:07:01 2022 +0800
Fix Spring Cloud metadata override (#11197)
---
.../metadata/SpringCloudServiceInstanceNotificationCustomizer.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/SpringCloudServiceInstanceNotificationCustomizer.java b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/SpringCloudServiceInstanceNotificationCustomizer.java
index c50dc36bc6..444f08fb69 100644
--- a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/SpringCloudServiceInstanceNotificationCustomizer.java
+++ b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/SpringCloudServiceInstanceNotificationCustomizer.java
@@ -31,7 +31,8 @@ public class SpringCloudServiceInstanceNotificationCustomizer implements Service
for (ServiceInstance instance : serviceInstance) {
if ("SPRING_CLOUD".equals(instance.getMetadata("preserved.register.source"))) {
MetadataInfo.ServiceInfo serviceInfo = new MetadataInfo.ServiceInfo("*", "*", "*", "rest", instance.getPort(), "*", new HashMap<>());
- MetadataInfo metadataInfo = new MetadataInfo(instance.getServiceName(), "SPRING_CLOUD", new ConcurrentHashMap<>(Collections.singletonMap("*", serviceInfo))) {
+ String revision = "SPRING_CLOUD-" + instance.getServiceName() + "-" + instance.getAddress() + "-" + instance.getPort();
+ MetadataInfo metadataInfo = new MetadataInfo(instance.getServiceName(), revision, new ConcurrentHashMap<>(Collections.singletonMap("*", serviceInfo))) {
@Override
public List<ServiceInfo> getMatchedServiceInfos(ProtocolServiceKey consumerProtocolServiceKey) {
getServices().putIfAbsent(consumerProtocolServiceKey.getServiceKeyString(),