From 7b0952b4b6749d2f1fbbcc4343ff100c657641c7 Mon Sep 17 00:00:00 2001 From: chickenlj Date: Thu, 11 Jul 2024 16:38:54 +0800 Subject: [PATCH] fix xds, append 'xds' cluster to url --- .../org/apache/dubbo/config/Constants.java | 2 +- .../apache/dubbo/config/ReferenceConfig.java | 3 ++- .../xds/registry/XdsServiceDiscovery.java | 26 +++++++++---------- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/Constants.java b/dubbo-common/src/main/java/org/apache/dubbo/config/Constants.java index 20f00376996..926cea93d65 100644 --- a/dubbo-common/src/main/java/org/apache/dubbo/config/Constants.java +++ b/dubbo-common/src/main/java/org/apache/dubbo/config/Constants.java @@ -168,7 +168,7 @@ public interface Constants { Set SUPPORT_MESH_TYPE = new HashSet() { { - addAll(Arrays.asList("istio")); + addAll(Arrays.asList("xds")); } }; } diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java index d1bf6e6f6ad..c28011d7fc2 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java @@ -727,7 +727,8 @@ private void checkInvokerAvailable(long timeout) throws IllegalStateException { long startTime = System.currentTimeMillis(); long checkDeadline = startTime + timeout; do { - logger.info("Waiting for service " + getUniqueServiceName() + " to be available..., set 'dubbo.consumer.check=false' to skip check."); + logger.info("Waiting for service " + getUniqueServiceName() + + " to be available..., set 'dubbo.consumer.check=false' to skip check."); try { Thread.sleep(100); } catch (InterruptedException e) { diff --git a/dubbo-xds/src/main/java/org/apache/dubbo/xds/registry/XdsServiceDiscovery.java b/dubbo-xds/src/main/java/org/apache/dubbo/xds/registry/XdsServiceDiscovery.java index 0bc2eacf1ec..febf221e3b4 100644 --- a/dubbo-xds/src/main/java/org/apache/dubbo/xds/registry/XdsServiceDiscovery.java +++ b/dubbo-xds/src/main/java/org/apache/dubbo/xds/registry/XdsServiceDiscovery.java @@ -36,21 +36,21 @@ public XdsServiceDiscovery(ApplicationModel applicationModel, URL registryURL) { } public void doInitialize(URL registryURL) { - try { - exchanger = PilotExchanger.initialize(registryURL); - } catch (Throwable t) { - logger.error(REGISTRY_ERROR_INITIALIZE_XDS, "", "", t.getMessage(), t); - } + try { + exchanger = PilotExchanger.initialize(registryURL); + } catch (Throwable t) { + logger.error(REGISTRY_ERROR_INITIALIZE_XDS, "", "", t.getMessage(), t); + } } public void doDestroy() { - try { - if (exchanger == null) { - return; - } - exchanger.destroy(); - } catch (Throwable t) { - logger.error(REGISTRY_ERROR_INITIALIZE_XDS, "", "", t.getMessage(), t); - } + try { + if (exchanger == null) { + return; + } + exchanger.destroy(); + } catch (Throwable t) { + logger.error(REGISTRY_ERROR_INITIALIZE_XDS, "", "", t.getMessage(), t); + } } }