mojieshui commented on code in PR #5014:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/5014#discussion_r2555268332
##########
service-registry/registry-service-center/src/main/java/org/apache/servicecomb/serviceregistry/refresh/ServiceRegistryAddressManager.java:
##########
@@ -54,4 +63,24 @@ public IpPort transformIpPort(String address) {
public void onRefreshEndpointEvent(RefreshEndpointEvent event) {
refreshEndpoint(event, RefreshEndpointEvent.SERVICE_CENTER_NAME);
}
+
+ public void constructAffinityAddress(List<String> addresses, String
ownRegion, String ownAvailableZone) {
+ boolean isAffinityAddress = addresses.stream().anyMatch(addr ->
addr.contains(ZONE) || addr.contains(REGION));
+ if (!isAffinityAddress || (StringUtils.isEmpty(ownRegion) &&
StringUtils.isEmpty(ownAvailableZone))) {
+ return;
+ }
+ String regionAndZone = "region=" + ownRegion + "&availableZone=" +
ownAvailableZone;
Review Comment:
region和az按照url的标准应该是无序的,建议通过url param解析后对比
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]