You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by li...@apache.org on 2024/03/25 03:13:12 UTC
(dubbo-samples) branch master updated: Upgrade 3-extensions/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter to jdk17 and springboot3 (#1111)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-samples.git
The following commit(s) were added to refs/heads/master by this push:
new 8f29abbe2 Upgrade 3-extensions/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter to jdk17 and springboot3 (#1111)
8f29abbe2 is described below
commit 8f29abbe20168e95d55527d44bc0f37850c04f32
Author: Allen442 <11...@users.noreply.github.com>
AuthorDate: Mon Mar 25 11:13:07 2024 +0800
Upgrade 3-extensions/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter to jdk17 and springboot3 (#1111)
---
.../case-configuration.yml | 10 +--
.../case-versions.conf | 6 +-
.../pom.xml | 81 ++++++++++++++++++++++
.../governance/consumer/ConsumerApplication.java | 30 ++++++++
.../samples/governance/consumer/task/Task.java | 41 +++++++++++
.../src/main/resources/application.yml | 28 ++++++++
.../src/main/resources/log4j2.xml | 0
.../dubbo/samples/consumer}/DemoServiceIT.java | 11 +--
.../pom.xml | 37 ++++++++++
.../dubbo/samples/governance/api/DemoService.java | 0
.../dubbo/samples/governance/api/DemoService2.java | 0
.../pom.xml | 76 ++++++++++++++++++++
.../governance/provider/ProviderApplication.java | 32 +++++++++
.../governance/provider}/impl/DemoServiceImpl.java | 29 +++++++-
.../provider}/impl/DemoServiceImpl2.java | 11 ++-
.../src/main/resources/application.yml | 34 +++++++++
.../src/main/resources/log4j2.xml | 0
.../pom.xml | 36 ++++++++++
.../dubbo/samples/governance/util/NacosUtils.java | 0
.../src/main/resources/dubbo-routers-condition.yml | 2 +-
.../dubbo-samples-nacos-conditionrouter/pom.xml | 40 +++++++----
.../dubbo/samples/governance/BasicConsumer.java | 42 -----------
.../dubbo/samples/governance/BasicProvider.java | 35 ----------
.../main/resources/spring/dubbo-demo-consumer.xml | 36 ----------
.../main/resources/spring/dubbo-demo-provider.xml | 43 ------------
25 files changed, 471 insertions(+), 189 deletions(-)
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-configuration.yml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-configuration.yml
index b13dcec10..fa3465c85 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-configuration.yml
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-configuration.yml
@@ -34,8 +34,8 @@ services:
dubbo-samples-nacos-conditionrouter1:
type: app
- basedir: .
- mainClass: org.apache.dubbo.samples.governance.BasicProvider
+ basedir: dubbo-samples-nacos-conditionrouter-provider
+ mainClass: org.apache.dubbo.samples.governance.provider.ProviderApplication
systemProps:
- nacos.address=nacos
- nacos.port=8848
@@ -50,8 +50,8 @@ services:
dubbo-samples-nacos-conditionrouter2:
type: app
- basedir: .
- mainClass: org.apache.dubbo.samples.governance.BasicProvider
+ basedir: dubbo-samples-nacos-conditionrouter-provider
+ mainClass: org.apache.dubbo.samples.governance.provider.ProviderApplication
systemProps:
- nacos.address=nacos
- nacos.port=8848
@@ -66,7 +66,7 @@ services:
dubbo-samples-nacos-conditionrouter-test:
type: test
- basedir: .
+ basedir: dubbo-samples-nacos-conditionrouter-consumer
tests:
- "**/*IT.class"
systemProps:
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-versions.conf b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-versions.conf
index f7373a530..82aeb4560 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-versions.conf
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/case-versions.conf
@@ -20,6 +20,6 @@
# Supported component versions of the test case
# Spring app
-dubbo.version=2.7*, 3.*
-spring.version=4.*, 5.*
-java.version= [>= 8]
+dubbo.version=3.3.*
+spring.version=6.*
+java.version= [>= 17]
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/pom.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/pom.xml
new file mode 100644
index 000000000..cadb4417b
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/pom.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-nacos-conditionrouter-consumer</artifactId>
+
+ <properties>
+ <java.version>17</java.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter-util</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter-interface</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <!-- dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+
+ <!-- spring starter -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/java/org/apache/dubbo/samples/governance/consumer/ConsumerApplication.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/java/org/apache/dubbo/samples/governance/consumer/ConsumerApplication.java
new file mode 100644
index 000000000..c133f4994
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/java/org/apache/dubbo/samples/governance/consumer/ConsumerApplication.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.samples.governance.consumer;
+
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableDubbo
+public class ConsumerApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(ConsumerApplication.class, args);
+ }
+}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/java/org/apache/dubbo/samples/governance/consumer/task/Task.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/java/org/apache/dubbo/samples/governance/consumer/task/Task.java
new file mode 100644
index 000000000..f2290f9a2
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/java/org/apache/dubbo/samples/governance/consumer/task/Task.java
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.dubbo.samples.governance.consumer.task;
+
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.apache.dubbo.samples.governance.api.DemoService;
+import org.apache.dubbo.samples.governance.api.DemoService2;
+import org.springframework.boot.CommandLineRunner;
+import org.springframework.stereotype.Component;
+
+@Component
+public class Task implements CommandLineRunner {
+ @DubboReference
+ private DemoService demoService;
+
+ @DubboReference
+ private DemoService2 demoService2;
+
+ @Override
+ public void run(String... args){
+ String hello = demoService.sayHello("world");
+ System.out.println("result: " + hello);
+
+ String hello2 = demoService2.sayHello("world again");
+ System.out.println("result: " + hello2);
+ }
+}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/resources/application.yml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/resources/application.yml
new file mode 100644
index 000000000..3de024f8f
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/resources/application.yml
@@ -0,0 +1,28 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+dubbo:
+ application:
+ name: governance-conditionrouter-consumer
+ registry:
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
+ config-center:
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
+ consumer:
+ check: false
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/log4j2.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/resources/log4j2.xml
similarity index 100%
copy from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/log4j2.xml
copy to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/main/resources/log4j2.xml
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/test/java/org/apache/dubbo/samples/governance/DemoServiceIT.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/test/java/org/apache/dubbo/samples/consumer/DemoServiceIT.java
similarity index 84%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/test/java/org/apache/dubbo/samples/governance/DemoServiceIT.java
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/test/java/org/apache/dubbo/samples/consumer/DemoServiceIT.java
index 549ffe2b9..9339c103e 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/test/java/org/apache/dubbo/samples/governance/DemoServiceIT.java
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-consumer/src/test/java/org/apache/dubbo/samples/consumer/DemoServiceIT.java
@@ -15,10 +15,11 @@
* limitations under the License.
*/
-package org.apache.dubbo.samples.governance;
+package org.apache.dubbo.samples.consumer;
import org.apache.dubbo.samples.governance.api.DemoService;
import org.apache.dubbo.samples.governance.api.DemoService2;
+import org.apache.dubbo.samples.governance.consumer.ConsumerApplication;
import org.apache.dubbo.samples.governance.util.NacosUtils;
import org.junit.Assert;
@@ -26,11 +27,11 @@ import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = {"classpath:/spring/dubbo-demo-consumer.xml"})
+@SpringBootTest(classes = {ConsumerApplication.class})
+@RunWith(SpringRunner.class)
public class DemoServiceIT {
@Autowired
private DemoService demoService;
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/pom.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/pom.xml
new file mode 100644
index 000000000..314a9e4ad
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-nacos-conditionrouter-interface</artifactId>
+
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+</project>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/api/DemoService.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/src/main/java/org/apache/dubbo/samples/governance/api/DemoService.java
similarity index 100%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/api/DemoService.java
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/src/main/java/org/apache/dubbo/samples/governance/api/DemoService.java
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/api/DemoService2.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/src/main/java/org/apache/dubbo/samples/governance/api/DemoService2.java
similarity index 100%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/api/DemoService2.java
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-interface/src/main/java/org/apache/dubbo/samples/governance/api/DemoService2.java
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/pom.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/pom.xml
new file mode 100644
index 000000000..5a0a875f4
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/pom.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-nacos-conditionrouter-provider</artifactId>
+
+ <properties>
+ <java.version>17</java.version>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter-interface</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <!-- dubbo -->
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ </dependency>
+
+ <!-- spring starter -->
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-log4j2</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/ProviderApplication.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/ProviderApplication.java
new file mode 100644
index 000000000..a9327251e
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/ProviderApplication.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.dubbo.samples.governance.provider;
+
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+@EnableDubbo
+public class ProviderApplication {
+
+ public static void main(String[] args) {
+ SpringApplication.run(ProviderApplication.class, args);
+ System.out.println("dubbo service started");
+ }
+}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/impl/DemoServiceImpl.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/impl/DemoServiceImpl.java
similarity index 51%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/impl/DemoServiceImpl.java
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/impl/DemoServiceImpl.java
index 87ed7417b..534fa0a3b 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/impl/DemoServiceImpl.java
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/impl/DemoServiceImpl.java
@@ -16,20 +16,43 @@
* limitations under the License.
*
*/
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.dubbo.samples.governance.provider.impl;
-package org.apache.dubbo.samples.governance.impl;
-
+import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.LoggerFactory;
+import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.dubbo.samples.governance.api.DemoService;
import java.text.SimpleDateFormat;
import java.util.Date;
+@DubboService
public class DemoServiceImpl implements DemoService {
+ private static Logger logger = LoggerFactory.getLogger(DemoService.class);
+
@Override
public String sayHello(String name) {
- System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " +
+ logger.warn("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " +
name + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/impl/DemoServiceImpl2.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/impl/DemoServiceImpl2.java
similarity index 76%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/impl/DemoServiceImpl2.java
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/impl/DemoServiceImpl2.java
index 31fa42bff..d2cadc6a5 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/impl/DemoServiceImpl2.java
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/java/org/apache/dubbo/samples/governance/provider/impl/DemoServiceImpl2.java
@@ -16,20 +16,25 @@
* limitations under the License.
*
*/
+package org.apache.dubbo.samples.governance.provider.impl;
-package org.apache.dubbo.samples.governance.impl;
-
+import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.LoggerFactory;
+import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcContext;
import org.apache.dubbo.samples.governance.api.DemoService2;
import java.text.SimpleDateFormat;
import java.util.Date;
+@DubboService
public class DemoServiceImpl2 implements DemoService2 {
+ private static Logger logger = LoggerFactory.getLogger(DemoService2.class);
+
@Override
public String sayHello(String name) {
- System.out.println("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " + name +
+ logger.warn("[" + new SimpleDateFormat("HH:mm:ss").format(new Date()) + "] Hello " + name +
", request from consumer: " + RpcContext.getContext().getRemoteAddress());
return "Hello " + name + ", response from provider: " + RpcContext.getContext().getLocalAddress();
}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/resources/application.yml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/resources/application.yml
new file mode 100644
index 000000000..5bdafb105
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/resources/application.yml
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+dubbo:
+ application:
+ logger: slf4j
+ name: governance-conditionrouter-provider
+ registry:
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
+ provider:
+ token: true
+ protocol:
+ name: dubbo
+ port: ${dubbo.port:20880}
+ heartbeat: 10000
+ config-center:
+ highest-priority: false
+ address: nacos://${nacos.address:127.0.0.1}:8848
+ username: nacos
+ password: nacos
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/log4j2.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/resources/log4j2.xml
similarity index 100%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/log4j2.xml
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-provider/src/main/resources/log4j2.xml
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/pom.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/pom.xml
new file mode 100644
index 000000000..b0786067c
--- /dev/null
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-nacos-conditionrouter</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-nacos-conditionrouter-util</artifactId>
+
+ <properties>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+</project>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/util/NacosUtils.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/src/main/java/org/apache/dubbo/samples/governance/util/NacosUtils.java
similarity index 100%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/util/NacosUtils.java
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/src/main/java/org/apache/dubbo/samples/governance/util/NacosUtils.java
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/dubbo-routers-condition.yml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/src/main/resources/dubbo-routers-condition.yml
similarity index 99%
rename from 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/dubbo-routers-condition.yml
rename to 3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/src/main/resources/dubbo-routers-condition.yml
index 1ee148d04..8615b09b7 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/dubbo-routers-condition.yml
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/dubbo-samples-nacos-conditionrouter-util/src/main/resources/dubbo-routers-condition.yml
@@ -27,4 +27,4 @@ key: governance-conditionrouter-consumer
conditions:
- interface=org.apache.dubbo.samples.governance.api.DemoService&method=sayHello=>address=*:20880
- interface=org.apache.dubbo.samples.governance.api.DemoService2&method=sayHello=>address=*:20881
-...
\ No newline at end of file
+...
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/pom.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/pom.xml
index 321fb4050..c612377d7 100644
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/pom.xml
+++ b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/pom.xml
@@ -26,31 +26,51 @@
<modelVersion>4.0.0</modelVersion>
+ <packaging>pom</packaging>
+
<artifactId>dubbo-samples-nacos-conditionrouter</artifactId>
<properties>
- <maven.compiler.source>1.8</maven.compiler.source>
- <maven.compiler.target>1.8</maven.compiler.target>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <dubbo.version>3.2.6</dubbo.version>
+ <dubbo.version>3.3.0-beta.1</dubbo.version>
<spring.version>4.3.30.RELEASE</spring.version>
<log4j2.version>2.20.0</log4j2.version>
<junit.version>4.13.1</junit.version>
+ <spring-boot.version>3.2.3</spring-boot.version>
<maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
</properties>
+ <modules>
+ <module>dubbo-samples-nacos-conditionrouter-interface</module>
+ <module>dubbo-samples-nacos-conditionrouter-consumer</module>
+ <module>dubbo-samples-nacos-conditionrouter-provider</module>
+ <module>dubbo-samples-nacos-conditionrouter-util</module>
+ </modules>
+
<dependencyManagement>
<dependencies>
<dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-framework-bom</artifactId>
- <version>${spring.version}</version>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-dependencies</artifactId>
+ <version>${spring-boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-bom</artifactId>
@@ -58,12 +78,6 @@
<type>pom</type>
<scope>import</scope>
</dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- </dependency>
</dependencies>
</dependencyManagement>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/BasicConsumer.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/BasicConsumer.java
deleted file mode 100644
index 2edb32bd7..000000000
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/BasicConsumer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.dubbo.samples.governance;
-
-import org.apache.dubbo.samples.governance.api.DemoService;
-import org.apache.dubbo.samples.governance.api.DemoService2;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-public class BasicConsumer {
-
- public static void main(String[] args) throws Exception {
- ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/dubbo-demo-consumer.xml");
- context.start();
-
- DemoService demoService = context.getBean("demoService", DemoService.class);
- DemoService2 demoService2 = context.getBean("demoService2", DemoService2.class);
-
- String hello = demoService.sayHello("world");
- System.out.println("result: " + hello);
-
- String hello2 = demoService2.sayHello("world again");
- System.out.println("result: " + hello2);
- }
-}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/BasicProvider.java b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/BasicProvider.java
deleted file mode 100644
index a59334c4d..000000000
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/java/org/apache/dubbo/samples/governance/BasicProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.dubbo.samples.governance;
-
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-import java.util.concurrent.CountDownLatch;
-
-public class BasicProvider {
-
- public static void main(String[] args) throws Exception {
- ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("spring/dubbo-demo-provider.xml");
- context.start();
-
- System.out.println("dubbo service started");
- new CountDownLatch(1).await();
- }
-}
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/spring/dubbo-demo-consumer.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/spring/dubbo-demo-consumer.xml
deleted file mode 100644
index aa1c00d9e..000000000
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/spring/dubbo-demo-consumer.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
- xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
- <context:property-placeholder/>
-
- <dubbo:application name="governance-conditionrouter-consumer"/>
-
- <dubbo:registry address="nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos"/>
-
- <dubbo:config-center highest-priority="false" address="nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos"/>
-
- <dubbo:reference id="demoService" check="false" interface="org.apache.dubbo.samples.governance.api.DemoService"/>
- <dubbo:reference id="demoService2" check="false" interface="org.apache.dubbo.samples.governance.api.DemoService2"/>
-</beans>
diff --git a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/spring/dubbo-demo-provider.xml b/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/spring/dubbo-demo-provider.xml
deleted file mode 100644
index 2b7cdb5ac..000000000
--- a/3-extensions/registry/dubbo-samples-nacos/dubbo-samples-nacos-conditionrouter/src/main/resources/spring/dubbo-demo-provider.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~
- ~ Licensed to the Apache Software Foundation (ASF) under one or more
- ~ contributor license agreements. See the NOTICE file distributed with
- ~ this work for additional information regarding copyright ownership.
- ~ The ASF licenses this file to You under the Apache License, Version 2.0
- ~ (the "License"); you may not use this file except in compliance with
- ~ the License. You may obtain a copy of the License at
- ~
- ~ http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing, software
- ~ distributed under the License is distributed on an "AS IS" BASIS,
- ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- ~ See the License for the specific language governing permissions and
- ~ limitations under the License.
- ~
- -->
-
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
- xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://dubbo.apache.org/schema/dubbo http://dubbo.apache.org/schema/dubbo/dubbo.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
- <context:property-placeholder/>
-
- <dubbo:application name="governance-conditionrouter-provider"/>
-
- <dubbo:registry address="nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos"/>
-
- <dubbo:provider token="true"/>
-
- <dubbo:protocol name="dubbo" port="${dubbo.port:20880}" heartbeat="10000"/>
-
- <dubbo:config-center highest-priority="false" address="nacos://${nacos.address:127.0.0.1}:8848?username=nacos&password=nacos"/>
-
- <bean id="demoService" class="org.apache.dubbo.samples.governance.impl.DemoServiceImpl"/>
- <dubbo:service interface="org.apache.dubbo.samples.governance.api.DemoService" ref="demoService"/>
-
- <bean id="demoService2" class="org.apache.dubbo.samples.governance.impl.DemoServiceImpl2"/>
- <dubbo:service interface="org.apache.dubbo.samples.governance.api.DemoService2" ref="demoService2"/>
-</beans>
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org