Merge branch 'master' into feat/native_samples
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml
new file mode 100644
index 0000000..623b20b
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/pom.xml
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-native-image</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>dubbo-samples-native-image-consumer</artifactId>
+
+ <properties>
+ <java.version>17</java.version>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-native-image-interface</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-netty4</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-jdk</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-fastjson2</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-api</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-dubbo</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>dubbo-remoting-zookeeper</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-reload4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <version>${spring-boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>${spring-boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-native</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-autoconfigure</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-hessian2</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-config-spring6</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-config-spring</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-web</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <release>17</release>
+ <fork>true</fork>
+ <verbose>true</verbose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>process-aot</id>
+ <goals>
+ <goal>process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.graalvm.buildtools</groupId>
+ <artifactId>native-maven-plugin</artifactId>
+ <version>0.9.20</version>
+ <configuration>
+ <classesDirectory>${project.build.outputDirectory}</classesDirectory>
+ <metadataRepository>
+ <enabled>true</enabled>
+ </metadataRepository>
+ <requiredVersion>22.3</requiredVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <id>add-reachability-metadata</id>
+ <goals>
+ <goal>add-reachability-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-maven-plugin</artifactId>
+ <version>${dubbo.version}</version>
+ <configuration>
+ <mainClass>org.apache.dubbo.nativeimage.consumer.NativeDemoConsumerApplication</mainClass>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>dubbo-process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java
new file mode 100644
index 0000000..702bed3
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/java/org/apache/dubbo/nativeimage/consumer/NativeDemoConsumerApplication.java
@@ -0,0 +1,29 @@
+package org.apache.dubbo.nativeimage.consumer;
+
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.apache.dubbo.nativeimage.DemoService;
+import org.apache.dubbo.nativeimage.HelloRequest;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+
+@SpringBootApplication(scanBasePackages = {"org.apache.dubbo.nativeimage.consumer"})
+@EnableDubbo(scanBasePackages = {"org.apache.dubbo.nativeimage.consumer"})
+public class NativeDemoConsumerApplication {
+
+ @DubboReference
+ private DemoService demoService;
+
+ public static void main(String[] args) throws InterruptedException {
+ ConfigurableApplicationContext context = SpringApplication.run(NativeDemoConsumerApplication.class, args);
+ NativeDemoConsumerApplication application = context.getBean(NativeDemoConsumerApplication.class);
+ String result = application.doSayHello("world");
+ System.out.println("result: " + result);
+ }
+
+ public String doSayHello(String name) {
+ return demoService.sayHello(new HelloRequest(name)).getResponse();
+ }
+
+}
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/resources/application.yml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/resources/application.yml
new file mode 100644
index 0000000..14bea93
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/resources/application.yml
@@ -0,0 +1,34 @@
+
+spring:
+ application:
+ name: dubbo-samples-nativeimage-consumer
+dubbo:
+ application:
+ name: ${spring.application.name}
+ logger: slf4j
+ compiler: jdk
+ qos-port: 22223
+ protocol:
+ name: dubbo
+ port: -1
+ serialization: fastjson2
+ registry:
+ id: zk-registry
+ address: zookeeper://127.0.0.1:2181
+ config-center:
+ address: zookeeper://127.0.0.1:2181
+ metadata-report:
+ address: zookeeper://127.0.0.1:2181
+ provider:
+ proxy: jdk
+ serialization: fastjson2
+ consumer:
+ proxy: jdk
+ serialization: fastjson2
+
+logging:
+ pattern:
+ level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'
+
+server:
+ port: 9091
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/resources/logback-spring.xml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..4085375
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-consumer/src/main/resources/logback-spring.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <include resource="org/springframework/boot/logging/logback/default.xml"/>
+ <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+ <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+ <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+
+ <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+ <property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>
+ <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
+
+ <root level="debug">
+ <appender-ref ref="CONSOLE" />
+ </root>
+ <logger name="org.springframework.web" level="debug"/>
+
+ <logger name="org.apache.dubbo" level="debug"/>
+</configuration>
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/pom.xml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/pom.xml
new file mode 100644
index 0000000..98f5f61
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/pom.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-native-image</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>dubbo-samples-native-image-interface</artifactId>
+
+ <properties>
+ <java.version>17</java.version>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ </properties>
+
+
+</project>
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/DemoService.java b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/DemoService.java
new file mode 100644
index 0000000..b58fd6b
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/DemoService.java
@@ -0,0 +1,13 @@
+package org.apache.dubbo.nativeimage;
+
+
+import java.util.concurrent.CompletableFuture;
+
+public interface DemoService {
+
+ HelloResponse sayHello(HelloRequest request);
+
+ default CompletableFuture<HelloResponse> sayHelloAsync(HelloRequest request) {
+ return CompletableFuture.completedFuture(sayHello(request));
+ }
+}
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/HelloRequest.java b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/HelloRequest.java
new file mode 100644
index 0000000..736d201
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/HelloRequest.java
@@ -0,0 +1,15 @@
+package org.apache.dubbo.nativeimage;
+
+import java.io.Serializable;
+
+public class HelloRequest implements Serializable {
+ private final String name;
+
+ public HelloRequest(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/HelloResponse.java b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/HelloResponse.java
new file mode 100644
index 0000000..9a7f4ba
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-interface/src/main/java/org/apache/dubbo/nativeimage/HelloResponse.java
@@ -0,0 +1,16 @@
+package org.apache.dubbo.nativeimage;
+
+
+import java.io.Serializable;
+
+public class HelloResponse implements Serializable {
+ private final String response;
+
+ public HelloResponse(String response) {
+ this.response = response;
+ }
+
+ public String getResponse() {
+ return response;
+ }
+}
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml
new file mode 100644
index 0000000..b41571d
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/pom.xml
@@ -0,0 +1,228 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-native-image</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>dubbo-samples-native-image-provider</artifactId>
+
+ <properties>
+ <java.version>17</java.version>
+ <maven.compiler.source>17</maven.compiler.source>
+ <maven.compiler.target>17</maven.compiler.target>
+ </properties>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-samples-native-image-interface</artifactId>
+ <version>${project.parent.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-remoting-netty4</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-jdk</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-fastjson2</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-api</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-rpc-dubbo</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-registry-zookeeper</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>dubbo-remoting-zookeeper</artifactId>
+ <groupId>org.apache.dubbo</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>slf4j-reload4j</artifactId>
+ <groupId>org.slf4j</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter</artifactId>
+ <version>${spring-boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-logging</artifactId>
+ <version>${spring-boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-web</artifactId>
+ <version>${spring-boot.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-native</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-spring-boot-starter</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-autoconfigure</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-serialization-hessian2</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-config-spring6</artifactId>
+ <version>${dubbo.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-config-spring</artifactId>
+ <version>${dubbo.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>spring-web</artifactId>
+ <groupId>org.springframework</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>native</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.10.1</version>
+ <configuration>
+ <release>17</release>
+ <fork>true</fork>
+ <verbose>true</verbose>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <version>${spring-boot-maven-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>process-aot</id>
+ <goals>
+ <goal>process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.graalvm.buildtools</groupId>
+ <artifactId>native-maven-plugin</artifactId>
+ <version>0.9.20</version>
+ <configuration>
+ <classesDirectory>${project.build.outputDirectory}</classesDirectory>
+ <metadataRepository>
+ <enabled>true</enabled>
+ </metadataRepository>
+ <requiredVersion>22.3</requiredVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <id>add-reachability-metadata</id>
+ <goals>
+ <goal>add-reachability-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>dubbo-maven-plugin</artifactId>
+ <version>${dubbo.version}</version>
+ <configuration>
+ <mainClass>org.apache.dubbo.nativeimage.provider.NativeDemoProviderApplication</mainClass>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>dubbo-process-aot</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/java/org/apache/dubbo/nativeimage/provider/DemoServiceImpl.java b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/java/org/apache/dubbo/nativeimage/provider/DemoServiceImpl.java
new file mode 100644
index 0000000..145acba
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/java/org/apache/dubbo/nativeimage/provider/DemoServiceImpl.java
@@ -0,0 +1,37 @@
+/*
+ * 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.nativeimage.provider;
+
+
+import org.apache.dubbo.config.annotation.DubboService;
+import org.apache.dubbo.nativeimage.DemoService;
+import org.apache.dubbo.nativeimage.HelloRequest;
+import org.apache.dubbo.nativeimage.HelloResponse;
+import org.apache.dubbo.rpc.RpcContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@DubboService
+public class DemoServiceImpl implements DemoService {
+
+ private static final Logger logger = LoggerFactory.getLogger(DemoServiceImpl.class);
+
+ public HelloResponse sayHello(HelloRequest request) {
+ logger.info("Hello " + request.getName() + ", request from consumer: " + RpcContext.getContext().getRemoteAddress());
+ return new HelloResponse(request.getName());
+ }
+}
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/java/org/apache/dubbo/nativeimage/provider/NativeDemoProviderApplication.java b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/java/org/apache/dubbo/nativeimage/provider/NativeDemoProviderApplication.java
new file mode 100644
index 0000000..416b611
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/java/org/apache/dubbo/nativeimage/provider/NativeDemoProviderApplication.java
@@ -0,0 +1,18 @@
+package org.apache.dubbo.nativeimage.provider;
+
+import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+import java.util.concurrent.CountDownLatch;
+
+@SpringBootApplication(scanBasePackages={"org.apache.dubbo.nativeimage.provider"})
+@EnableDubbo(scanBasePackages = {"org.apache.dubbo.nativeimage.provider"})
+public class NativeDemoProviderApplication {
+
+ public static void main(String[] args) throws InterruptedException {
+ SpringApplication.run(NativeDemoProviderApplication.class, args);
+ System.out.println("dubbo service started");
+ new CountDownLatch(1).await();
+ }
+}
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/resources/application.yml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/resources/application.yml
new file mode 100644
index 0000000..33ce079
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/resources/application.yml
@@ -0,0 +1,33 @@
+
+spring:
+ application:
+ name: dubbo-samples-nativeimage-provider
+dubbo:
+ application:
+ name: ${spring.application.name}
+ logger: slf4j
+ compiler: jdk
+ protocol:
+ name: dubbo
+ port: -1
+ serialization: fastjson2
+ registry:
+ id: zk-registry
+ address: zookeeper://127.0.0.1:2181
+ config-center:
+ address: zookeeper://127.0.0.1:2181
+ metadata-report:
+ address: zookeeper://127.0.0.1:2181
+ provider:
+ proxy: jdk
+ serialization: fastjson2
+ consumer:
+ proxy: jdk
+ serialization: fastjson2
+
+logging:
+ pattern:
+ level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'
+
+server:
+ port: 9090
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/resources/logback-spring.xml b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/resources/logback-spring.xml
new file mode 100644
index 0000000..4085375
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/dubbo-samples-native-image-provider/src/main/resources/logback-spring.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration>
+ <include resource="org/springframework/boot/logging/logback/default.xml"/>
+ <conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
+ <conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
+ <conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
+
+ <property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+ <property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>
+ <include resource="org/springframework/boot/logging/logback/console-appender.xml" />
+
+ <root level="debug">
+ <appender-ref ref="CONSOLE" />
+ </root>
+ <logger name="org.springframework.web" level="debug"/>
+
+ <logger name="org.apache.dubbo" level="debug"/>
+</configuration>
\ No newline at end of file
diff --git a/1-basic/dubbo-samples-native-image/pom.xml b/1-basic/dubbo-samples-native-image/pom.xml
new file mode 100644
index 0000000..2118065
--- /dev/null
+++ b/1-basic/dubbo-samples-native-image/pom.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.dubbo</groupId>
+ <artifactId>1-basic</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dubbo-samples-native-image</artifactId>
+ <packaging>pom</packaging>
+ <modules>
+ <module>dubbo-samples-native-image-provider</module>
+ <module>dubbo-samples-native-image-interface</module>
+ <module>dubbo-samples-native-image-consumer</module>
+ </modules>
+
+ <properties>
+ <java.version>17</java.version>
+ <dubbo.version>3.3.0-beta.1-SNAPSHOT</dubbo.version>
+ <spring-boot.version>3.0.5</spring-boot.version>
+ <spring-boot-maven-plugin.version>3.0.5</spring-boot-maven-plugin.version>
+ </properties>
+
+</project>
\ No newline at end of file
diff --git a/1-basic/pom.xml b/1-basic/pom.xml
index fd21b1f..c0d86f8 100644
--- a/1-basic/pom.xml
+++ b/1-basic/pom.xml
@@ -32,5 +32,6 @@
<module>dubbo-samples-spring-xml</module>
<module>dubbo-samples-spring-boot</module>
<module>dubbo-samples-triple-unary</module>
+ <module>dubbo-samples-native-image</module>
</modules>
</project>
\ No newline at end of file