You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: dubbo/dubbo-plugins/dubbo-metadatareport-polaris/src/main/java/com/tencent/polaris/dubbo/metadata/report/PolarisMetadataReport.java
+31-3Lines changed: 31 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -145,14 +145,16 @@ public void publishAppMetadata(SubscriberMetadataIdentifier identifier, Metadata
145
145
146
146
@Override
147
147
public MetadataInfo getAppMetadata(SubscriberMetadataIdentifier identifier, Map<String, String> instanceMetadata) {
148
+
// 这里由于查询的应用的接口定义数据,这里不能设置 version,必须显示设置 version 为空
148
149
GetServiceContractRequest request = new GetServiceContractRequest();
149
150
request.setName(formatAppMetaName(identifier));
150
151
request.setService(identifier.getApplication());
151
152
request.setVersion("");
152
153
153
154
Optional<ServiceContractProto.ServiceContract> result = getServiceContract(request);
154
155
if (!result.isPresent()) {
155
-
return new MetadataInfo();
156
+
// 这里返回一个空的 MetadataInfo
157
+
return MetadataInfo.EMPTY;
156
158
}
157
159
158
160
Map<String, MetadataInfo.ServiceInfo> serviceInfos = new HashMap<>();
@@ -163,6 +165,7 @@ public MetadataInfo getAppMetadata(SubscriberMetadataIdentifier identifier, Map<
163
165
return new MetadataInfo(identifier.getApplication(), identifier.getRevision(), serviceInfos);
Copy file name to clipboardExpand all lines: dubbo/dubbo-plugins/dubbo-registry-polaris/src/main/java/com/tencent/polaris/dubbo/registry/PolarisServiceDiscovery.java
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -133,19 +133,20 @@ public void addServiceInstancesChangedListener(ServiceInstancesChangedListener
0 commit comments