From f7f61629f6a322182ae1e2a8431de4f03aad700d Mon Sep 17 00:00:00 2001 From: hujiatai <82449866+hujiatai@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:53:22 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:dubbo=E6=8F=92=E4=BB=B6=E5=9C=A8dubbo?= =?UTF-8?q?=203.0=E6=97=B6=EF=BC=8C=E5=8F=AA=E4=BD=BF=E7=94=A8=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E6=9C=8D=E5=8A=A1=E6=9A=B4=E9=9C=B2=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96=E5=88=B0?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9C=8D=E5=8A=A1=E7=9A=84=E6=8F=90=E4=BE=9B?= =?UTF-8?q?=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 该处解决dubbo3.0后实例服务发现时,当默认使用注册中心的地址作为元数据中心时,无法使用到默认的元数据中心获取到接口的提供者,导致rpc失败 修改此次后当没有配置元数据中心时会使用注册中心的地址作为元数据中心 2.6.1版本启用dubbo插件时没有配置元数据中心的地址配置,后续应前后端都允许元数据中心的配置 --- .../plugin/apache/dubbo/cache/ApacheDubboConfigCache.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java index 329d54568884..457204420b60 100644 --- a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java +++ b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java @@ -199,6 +199,10 @@ private ReferenceConfig buildReference(final MetaData metaData, reference.setRegistry(registryConfig); reference.setConsumer(consumerConfig); reference.setInterface(metaData.getServiceName()); + // 该处解决dubbo3.0后实例服务发现时,当默认使用注册中心的地址作为元数据中心时,无法使用到默认的元数据中心获取到接口的提供者,导致rpc失败 + // 修改此次后当没有配置元数据中心时会使用注册中心的地址作为元数据中心 + // 2.6.1版本启用dubbo插件时没有配置元数据中心的地址配置,后续应前后端都允许元数据中心的配置 + reference.getApplicationModel().getApplicationConfigManager().addConfig(registryConfig); // default protocol is dubbo reference.setProtocol("dubbo"); reference.setCheck(false); From 7e6a8695fafe0bf88b47661151e1571b03fee019 Mon Sep 17 00:00:00 2001 From: hujiatai <82449866+hujiatai@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:23:01 +0800 Subject: [PATCH 2/3] [type:fix] dubbo plugin In dubbo 3.0, when only instance service is used to expose the registration, the provider of interface service cannot be obtained When solving the instance service discovery after dubbo3.0, when the default address of the registration center is used as the metadata center, the default metadata center cannot be used to obtain the interface provider, resulting in rpc failure When no metadata center is configured after this modification, the address of the registry will be used as the metadata center The address configuration of the metadata center is not configured when the dubbo plug-in is enabled in version 2.6.1, and the configuration of the metadata center should be allowed in both the front-end and back-end in the future --- .../plugin/apache/dubbo/cache/ApacheDubboConfigCache.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java index 457204420b60..58d97d62fcdd 100644 --- a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java +++ b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java @@ -199,9 +199,10 @@ private ReferenceConfig buildReference(final MetaData metaData, reference.setRegistry(registryConfig); reference.setConsumer(consumerConfig); reference.setInterface(metaData.getServiceName()); - // 该处解决dubbo3.0后实例服务发现时,当默认使用注册中心的地址作为元数据中心时,无法使用到默认的元数据中心获取到接口的提供者,导致rpc失败 - // 修改此次后当没有配置元数据中心时会使用注册中心的地址作为元数据中心 - // 2.6.1版本启用dubbo插件时没有配置元数据中心的地址配置,后续应前后端都允许元数据中心的配置 + + // When solving the instance service discovery after dubbo3.0, when the default address of the registration center is used as the metadata center, the default metadata center cannot be used to obtain the interface provider, resulting in rpc failure + // When no metadata center is configured after this modification, the address of the registry will be used as the metadata center + // The address configuration of the metadata center is not configured when the dubbo plug-in is enabled in version 2.6.1, and the configuration of the metadata center should be allowed in both the front-end and back-end in the future reference.getApplicationModel().getApplicationConfigManager().addConfig(registryConfig); // default protocol is dubbo reference.setProtocol("dubbo"); From ae73dcc813118921aab0e1250837facfcdfde886 Mon Sep 17 00:00:00 2001 From: hujiatai <82449866+hujiatai@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:28:32 +0800 Subject: [PATCH 3/3] Fix dubbo3.0 cannot get service provider information #5708 Fix dubbo3.0 cannot get service provider information #5708 --- .../plugin/apache/dubbo/cache/ApacheDubboConfigCache.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java index 58d97d62fcdd..6f168a630028 100644 --- a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java +++ b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-dubbo/shenyu-plugin-apache-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java @@ -200,9 +200,7 @@ private ReferenceConfig buildReference(final MetaData metaData, reference.setConsumer(consumerConfig); reference.setInterface(metaData.getServiceName()); - // When solving the instance service discovery after dubbo3.0, when the default address of the registration center is used as the metadata center, the default metadata center cannot be used to obtain the interface provider, resulting in rpc failure - // When no metadata center is configured after this modification, the address of the registry will be used as the metadata center - // The address configuration of the metadata center is not configured when the dubbo plug-in is enabled in version 2.6.1, and the configuration of the metadata center should be allowed in both the front-end and back-end in the future + // Fix dubbo3.0 cannot get service provider information #5708 reference.getApplicationModel().getApplicationConfigManager().addConfig(registryConfig); // default protocol is dubbo reference.setProtocol("dubbo");