zlshi opened a new issue, #13094: URL: https://github.com/apache/dubbo/issues/13094
I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate. Environment - Dubbo version: 3.2.0 - Operating System version: win10 - Java version: 1.8 - Nacos2.1.2 Standalone启动 复现步骤: 1. 下载Nacos2.1.2版本包,并修改application.properties配置文件端口分别为8848和8858,然后执行 ./startup.cmd -m standalone启动 2. 在官方dubbo-3.2.0 Tag版本代码dubbo-demo/dubbo-demo-spring-boot/dubbo-demo-spring-boot-provider目录下修改pom.xml文件,移除zookeeper依赖,引入dubbo-registry-nacos依赖 ``` <!-- <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-registry-zookeeper</artifactId> </dependency> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-configcenter-zookeeper</artifactId> </dependency> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-metadata-report-zookeeper</artifactId> </dependency>--> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-registry-nacos</artifactId> </dependency> ``` 4. 创建如下测试类并运行,可以发现能在正常注册到两个nacos中,但是unexport时只取消了第一个nacos上的注册,第二个没有取消 ``` package org.apache.dubbo.springboot.demo.provider; import org.apache.dubbo.common.constants.CommonConstants; import org.apache.dubbo.config.ApplicationConfig; import org.apache.dubbo.config.ProtocolConfig; import org.apache.dubbo.config.RegistryConfig; import org.apache.dubbo.config.ServiceConfig; import org.apache.dubbo.config.bootstrap.DubboBootstrap; import org.apache.dubbo.springboot.demo.DemoService; import java.util.Arrays; public class TestMultiRegistryBug { public static void main(String[] args) throws InterruptedException { startWithBootstrap(); } private static void startWithBootstrap() throws InterruptedException { ServiceConfig<DemoServiceImpl> service = new ServiceConfig<>(); service.setInterface(DemoService.class); service.setRef(new DemoServiceImpl()); RegistryConfig beijing = new RegistryConfig(); beijing.setAddress("nacos://nacos:nacos@localhost:8848/"); RegistryConfig hangzhou = new RegistryConfig(); hangzhou.setAddress("nacos://nacos:nacos@localhost:8858/"); service.setRegistries(Arrays.asList(beijing, hangzhou)); DubboBootstrap bootstrap = DubboBootstrap.getInstance(); bootstrap.application(new ApplicationConfig("test-dual-center-registry-bug")) .protocol(new ProtocolConfig(CommonConstants.DUBBO, -1)) .service(service) .start(); Thread.sleep(20000); // 执行下面的代码 System.out.println("======= Dubbo service started ============"); service.unexport(); } } ```  第二个Nacos  第一个Nacos  当服务需要优雅下线时,不能下线掉所有的Nacos注册中心 -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
