This is an automated email from the ASF dual-hosted git repository.

xuetaoli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git


The following commit(s) were added to refs/heads/main by this push:
     new d1f556c0 feat: add generic samples (#973)
d1f556c0 is described below

commit d1f556c08c761760e3520ba10636b8cee4d45fd3
Author: yxrxy <[email protected]>
AuthorDate: Mon Dec 1 13:56:02 2025 +0800

    feat: add generic samples (#973)
    
    * feat: add generaic and group_subscription tests
---
 README.md                                          |   1 +
 README_CN.md                                       |   1 +
 generic/README.md                                  |  88 ++++++++++
 generic/README_zh.md                               |  88 ++++++++++
 generic/build/test.sh                              |  92 ++++++++++
 generic/go-client/cmd/client.go                    | 158 +++++++++++++++++
 generic/go-client/pkg/user.go                      |  33 ++++
 generic/go-server/cmd/server.go                    | 133 ++++++++++++++
 generic/go-server/pkg/init.go                      |  28 +++
 generic/go-server/pkg/user.go                      |  40 +++++
 generic/go-server/pkg/user_provider.go             | 118 +++++++++++++
 generic/go-server/pkg/user_response.go             |  26 +++
 .../java-client/dependency-reduced-pom.xml         | 188 ++++++++++++++++++++
 generic/java-client/java-client/pom.xml            | 194 +++++++++++++++++++++
 generic/java-client/java-client/run.sh             |   1 +
 .../java/org/apache/dubbo/samples/ApiConsumer.java |  75 ++++++++
 .../main/java/org/apache/dubbo/samples/Gender.java |  23 +++
 .../java/org/apache/dubbo/samples/Response.java    |  92 ++++++++++
 .../main/java/org/apache/dubbo/samples/User.java   |  90 ++++++++++
 .../org/apache/dubbo/samples/UserProvider.java     |  36 ++++
 .../src/main/resources/dubbo.properties            |   8 +
 .../src/main/resources/log4j.properties            |  19 ++
 .../java-server/dependency-reduced-pom.xml         | 178 +++++++++++++++++++
 generic/java-server/java-server/pom.xml            | 184 +++++++++++++++++++
 generic/java-server/java-server/run.sh             |   1 +
 .../java/org/apache/dubbo/samples/ApiProvider.java |  41 +++++
 .../main/java/org/apache/dubbo/samples/Gender.java |  23 +++
 .../java/org/apache/dubbo/samples/Response.java    |  92 ++++++++++
 .../main/java/org/apache/dubbo/samples/User.java   |  90 ++++++++++
 .../org/apache/dubbo/samples/UserProvider.java     |  44 +++++
 .../org/apache/dubbo/samples/UserProviderImpl.java | 106 +++++++++++
 .../src/main/resources/dubbo.properties            |   8 +
 .../src/main/resources/log4j.properties            |  20 +++
 start_integrate_test.sh                            |   3 +-
 34 files changed, 2320 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 6c62656c..11489e22 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,7 @@ A collection of runnable Dubbo-go examples covering 
configuration, registries, o
 * `helloworld`: Basic “Hello World” example for Dubbo-go, also includes 
Go–Java interoperability.
 * `direct`: Triple point-to-point invocation sample without a registry.
 * `game`: Game service example.
+* `generic`: Generic invocation examples supporting interoperability between 
Dubbo-Go and Dubbo Java services, suitable for scenarios without interface 
information.
 * `integrate_test`: Integration test cases for Dubbo-go samples.
 * `java_interop`: Demonstrates interoperability between Java and Go Dubbo 
implementations.
 * `llm`: Example of integrating Large Language Models (LLMs) with Dubbo-go.
diff --git a/README_CN.md b/README_CN.md
index fc422ca6..b33f646b 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -22,6 +22,7 @@
 * `helloworld`:Dubbo-go 最基础的 “Hello World” 示例,同时包含 Go 与 Java 的互操作示例。
 * `direct`:不依赖注册中心的 Triple 点对点调用示例。
 * `game`:游戏服务示例。
+* `generic`:泛化调用示例,支持 Dubbo-Go 与 Dubbo Java 服务互操作,适用于无接口信息场景。
 * `integrate_test`:Dubbo-go 示例的集成测试用例。
 * `java_interop`:展示 Java 与 Go Dubbo 实现之间的互操作能力。
 * `llm`:将大模型(LLM)集成到 Dubbo-go 中的示例。
diff --git a/generic/README.md b/generic/README.md
new file mode 100644
index 00000000..d923c2ed
--- /dev/null
+++ b/generic/README.md
@@ -0,0 +1,88 @@
+# Generic Call
+
+Generic call is a mechanism that ensures information is correctly transmitted 
when the client does not have interface information. It generalizes POJOs into 
generic formats (such as dictionaries, strings), and is generally used in 
scenarios like integration testing and gateways.
+
+This example demonstrates generic calls between Dubbo-Go and Dubbo Java 
services, showing how services can interoperate regardless of the language 
they're implemented in.
+
+## Directory Structure
+
+- go-server: Dubbo-Go server example
+- go-client: Dubbo-Go client example with generic calls
+- java-client: Dubbo Java client example
+- java-server: Dubbo Java server example
+- build: For integration test
+
+Dubbo Java examples can be used to test interoperability with Dubbo-Go. You 
can start java server with go client, or go server with java client for testing.
+
+## Prerequisites
+
+- Docker and Docker Compose for running ZooKeeper registry
+- Go 1.23+ for Dubbo-Go examples
+- Java 8+ and Maven for Dubbo Java examples
+
+## Registry
+
+This example uses ZooKeeper as the registry. The following command starts 
ZooKeeper from docker, so you need to ensure that docker and docker-compose are 
installed first.
+
+```shell
+# Start ZooKeeper registry
+docker run -d --name zookeeper -p 2181:2181 zookeeper:3.4.14
+```
+
+## Running the Examples
+
+### Dubbo-Go Server
+
+Using Dubbo-Go as provider, you can start it from command line tool:
+
+```shell
+cd go-server/cmd && go run server.go
+```
+
+### Dubbo-Go Client (Generic Call)
+
+Using Dubbo-Go as consumer with generic calls:
+
+```shell
+cd go-client/cmd && go run client.go
+```
+
+### Dubbo Java Server
+
+Using Dubbo Java as provider:
+
+```shell
+cd java-server/java-server
+mvn clean package
+sh run.sh
+```
+
+### Dubbo Java Client
+
+Using Dubbo Java as consumer:
+
+```shell
+cd java-client/java-client
+mvn clean package
+sh run.sh
+```
+
+## Testing Interoperability
+
+This example is designed to test interoperability between Dubbo-Go and Dubbo 
Java:
+
+1. Start the ZooKeeper registry
+2. Start either go-server or java-server
+3. Run either go-client or java-client to test the generic calls
+
+The client will make various generic calls to the server, including:
+- GetUser1(String userId)
+- GetUser2(String userId, String name)
+- GetUser3(int userCode)
+- GetUser4(int userCode, String name)
+- GetOneUser()
+- GetUsers(String[] userIdList)
+- GetUsersMap(String[] userIdList)
+- QueryUser(User user)
+- QueryUsers(List<User> userObjectList)
+- QueryAll()
\ No newline at end of file
diff --git a/generic/README_zh.md b/generic/README_zh.md
new file mode 100644
index 00000000..5ed811c5
--- /dev/null
+++ b/generic/README_zh.md
@@ -0,0 +1,88 @@
+# 泛化调用
+
+泛化调用是在客户端没有接口信息时保证信息被正确传递的手段,即把 POJO 泛化为通用格式(如字典、字符串),一般被用于集成测试、网关等场景。
+
+本示例演示了 Dubbo-Go 和 Dubbo Java 服务之间的泛化调用,展示了不同语言实现的服务如何互操作。
+
+## 目录结构
+
+- go-server: Dubbo-Go 服务端示例
+- go-client: Dubbo-Go 客户端示例(泛化调用)
+- java-client: Dubbo Java 客户端示例
+- java-server: Dubbo Java 服务端示例
+- build: 集成测试需要的脚本
+
+Dubbo Java 示例可以用来测试与 Dubbo-Go 的互操作性。您可以启动 java 服务端配合 go 客户端,或者启动 go 服务端配合 java 
客户端进行测试。
+
+## 环境准备
+
+- Docker 和 Docker Compose 用于运行 ZooKeeper 注册中心
+- Go 1.23+ 用于 Dubbo-Go 示例
+- Java 8+ 和 Maven 用于 Dubbo Java 示例
+
+## 注册中心
+
+本示例使用 ZooKeeper 作为注册中心。以下命令通过 docker 启动 ZooKeeper,因此需要确保已安装 docker 和 
docker-compose。
+
+```shell
+# 启动 ZooKeeper 注册中心
+docker run -d --name zookeeper -p 2181:2181 zookeeper:3.4.14
+```
+
+## 运行示例
+
+### Dubbo-Go 服务端
+
+使用 Dubbo-Go 作为服务提供者,可以通过命令行工具启动:
+
+```shell
+cd go-server/cmd && go run server.go
+```
+
+### Dubbo-Go 客户端(泛化调用)
+
+使用 Dubbo-Go 作为服务消费者进行泛化调用:
+
+```shell
+cd go-client/cmd && go run client.go
+```
+
+### Dubbo Java 服务端
+
+使用 Dubbo Java 作为服务提供者:
+
+```shell
+cd java-server/java-server
+mvn clean package
+sh run.sh
+```
+
+### Dubbo Java 客户端
+
+使用 Dubbo Java 作为服务消费者:
+
+```shell
+cd java-client/java-client
+mvn clean package
+sh run.sh
+```
+
+## 测试互操作性
+
+本示例旨在测试 Dubbo-Go 和 Dubbo Java 之间的互操作性:
+
+1. 启动 ZooKeeper 注册中心
+2. 启动 go-server 或 java-server 之一
+3. 运行 go-client 或 java-client 之一来测试泛化调用
+
+客户端将向服务端发起多种泛化调用,包括:
+- GetUser1(String userId)
+- GetUser2(String userId, String name)
+- GetUser3(int userCode)
+- GetUser4(int userCode, String name)
+- GetOneUser()
+- GetUsers(String[] userIdList)
+- GetUsersMap(String[] userIdList)
+- QueryUser(User user)
+- QueryUsers(List<User> userObjectList)
+- QueryAll()
\ No newline at end of file
diff --git a/generic/build/test.sh b/generic/build/test.sh
new file mode 100755
index 00000000..def376ad
--- /dev/null
+++ b/generic/build/test.sh
@@ -0,0 +1,92 @@
+#!/bin/bash
+
+# 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.
+
+echo "Running custom generic test script"
+
+# Check if project directory is provided
+if [ -z "$1" ]; then
+    echo "Project directory not provided"
+    exit 1
+fi
+
+P_DIR="$1"
+echo "Using project directory: $P_DIR"
+
+# Function to clean up
+cleanup() {
+    echo "Cleaning up..."
+    # Kill any running server processes
+    if [ -f "/tmp/.generic-server.pid" ]; then
+        kill $(cat /tmp/.generic-server.pid) 2>/dev/null || true
+        rm -f /tmp/.generic-server.pid
+    fi
+}
+
+# Set trap to ensure cleanup happens
+trap cleanup EXIT INT TERM
+
+# Build and start server
+echo "Building and starting server..."
+cd "$P_DIR/go-server/cmd"
+go build -o server .
+if [ $? -ne 0 ]; then
+    echo "Failed to build server"
+    exit 1
+fi
+
+# Start server in background
+echo "Starting server..."
+./server > server.log 2>&1 &
+SERVER_PID=$!
+echo $SERVER_PID > /tmp/.generic-server.pid
+echo "Server started with PID: $SERVER_PID"
+
+# Wait for server to start and register with Zookeeper
+echo "Waiting for server to register with Zookeeper..."
+sleep 15
+
+# Check if server is running
+if ! kill -0 $SERVER_PID 2>/dev/null; then
+    echo "Server failed to start. Check server.log for details:"
+    cat server.log
+    exit 1
+fi
+
+# Build and run client
+echo "Building and running client..."
+cd "$P_DIR/go-client/cmd"
+go build -o client .
+if [ $? -eq 0 ]; then
+    ./client
+    RESULT=$?
+    rm -f client
+else
+    echo "Failed to build client"
+    RESULT=1
+fi
+
+# Print server log if client failed
+if [ $RESULT -ne 0 ]; then
+    echo "Client failed, printing server log..."
+    echo "=== Server Log ==="
+    cat "$P_DIR/go-server/cmd/server.log"
+fi
+
+# Clean up
+cleanup
+
+exit $RESULT
\ No newline at end of file
diff --git a/generic/go-client/cmd/client.go b/generic/go-client/cmd/client.go
new file mode 100644
index 00000000..f20701f7
--- /dev/null
+++ b/generic/go-client/cmd/client.go
@@ -0,0 +1,158 @@
+/*
+ * 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 main
+
+import (
+       "context"
+       "time"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3"
+       "dubbo.apache.org/dubbo-go/v3/client"
+       "dubbo.apache.org/dubbo-go/v3/common/constant"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+       "dubbo.apache.org/dubbo-go/v3/registry"
+
+       hessian "github.com/apache/dubbo-go-hessian2"
+
+       "github.com/dubbogo/gost/log/logger"
+)
+
+import (
+       "github.com/apache/dubbo-go-samples/generic/go-client/pkg"
+)
+
+const (
+       RegistryAddress    = "127.0.0.1:2181"
+       UserProvider       = "org.apache.dubbo.samples.UserProvider"
+       ServiceVersion     = "1.0.0"
+       ServiceGroupTriple = "dubbo"
+)
+
+func createServiceConnection(cli *client.Client, serviceInterface string) 
(*client.Connection, error) {
+       return cli.Dial(
+               serviceInterface,
+               client.WithGeneric(),
+               client.WithVersion(ServiceVersion),
+               client.WithGroup(ServiceGroupTriple),
+       )
+}
+
+func main() {
+       hessian.RegisterPOJO(&pkg.User{})
+
+       ins, err := dubbo.NewInstance(
+               dubbo.WithName("generic-dubbo-client"),
+               dubbo.WithRegistry(
+                       registry.WithZookeeper(),
+                       registry.WithAddress(RegistryAddress),
+               ),
+       )
+       if err != nil {
+               logger.Fatalf("Failed to create Dubbo instance: %v", err)
+       }
+
+       tripleCli, err := ins.NewClient(
+               client.WithClientProtocolDubbo(),
+               client.WithClientSerialization(constant.Hessian2Serialization),
+       )
+       if err != nil {
+               logger.Fatalf("Failed to create Dubbo client: %v", err)
+       }
+
+       tripleConn, err := createServiceConnection(tripleCli, UserProvider)
+       if err != nil {
+               logger.Fatalf("Failed to create Dubbo connection: %v", err)
+       }
+
+       logger.Info("\n=== Testing Dubbo Protocol ===")
+       testUserService(tripleConn)
+}
+
+func testUserService(conn *client.Connection) {
+       call := func(methodName string, params []interface{}) (interface{}, 
error) {
+               var result interface{}
+               err := conn.CallUnary(
+                       context.TODO(),
+                       params,
+                       &result,
+                       methodName,
+               )
+               return result, err
+       }
+
+       testUserID := "A003"
+       testUserName := "lily"
+       testUserCode := int32(1)
+       testUserIDs := []string{"001", "002", "003", "004"}
+
+       testUser := &pkg.User{
+               ID:   "3213",
+               Name: "panty",
+               Age:  25,
+               Time: time.Now(),
+       }
+
+       testUsers := []*pkg.User{
+               {
+                       ID:   "3212",
+                       Name: "XavierNiu",
+                       Age:  24,
+                       Time: time.Now().Add(4),
+               },
+               {
+                       ID:   "3213",
+                       Name: "zhangsan",
+                       Age:  21,
+                       Time: time.Now().Add(4),
+               },
+       }
+
+       result, err := call("GetUser1", []interface{}{testUserID})
+       logResult("GetUser1", result, err)
+
+       result, err = call("GetUser2", []interface{}{testUserID, testUserName})
+       logResult("GetUser2", result, err)
+
+       result, err = call("GetUser3", []interface{}{testUserCode})
+       logResult("GetUser3", result, err)
+
+       result, err = call("GetUser4", []interface{}{testUserCode, "zhangsan"})
+       logResult("GetUser4", result, err)
+
+       result, err = call("GetUsers", []interface{}{testUserIDs})
+       logResult("GetUsers", result, err)
+
+       result, err = call("GetUsersMap", []interface{}{testUserIDs})
+       logResult("GetUsersMap", result, err)
+
+       result, err = call("QueryUser", []interface{}{testUser})
+       logResult("QueryUser", result, err)
+
+       result, err = call("QueryUsers", []interface{}{testUsers})
+       logResult("QueryUsers", result, err)
+}
+
+func logResult(methodName string, result interface{}, err error) {
+       if err != nil {
+               logger.Errorf("❌ %s failed: %v", methodName, err)
+       } else {
+               logger.Infof("✅ %s succeeded: %+v", methodName, result)
+       }
+}
diff --git a/generic/go-client/pkg/user.go b/generic/go-client/pkg/user.go
new file mode 100644
index 00000000..b7ed2dc8
--- /dev/null
+++ b/generic/go-client/pkg/user.go
@@ -0,0 +1,33 @@
+/*
+ * 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 pkg
+
+import (
+       "time"
+)
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+func (u *User) JavaClassName() string {
+       return "org.apache.dubbo.samples.User"
+}
diff --git a/generic/go-server/cmd/server.go b/generic/go-server/cmd/server.go
new file mode 100644
index 00000000..5424ddaf
--- /dev/null
+++ b/generic/go-server/cmd/server.go
@@ -0,0 +1,133 @@
+/*
+ * 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 main
+
+import (
+       "os"
+       "os/signal"
+       "syscall"
+)
+
+import (
+       "dubbo.apache.org/dubbo-go/v3"
+       "dubbo.apache.org/dubbo-go/v3/common"
+       _ "dubbo.apache.org/dubbo-go/v3/imports"
+       "dubbo.apache.org/dubbo-go/v3/protocol"
+       "dubbo.apache.org/dubbo-go/v3/registry"
+       "dubbo.apache.org/dubbo-go/v3/server"
+
+       hessian "github.com/apache/dubbo-go-hessian2"
+
+       "github.com/dubbogo/gost/log/logger"
+)
+
+import (
+       pkg2 "github.com/apache/dubbo-go-samples/generic/go-server/pkg"
+)
+
+const (
+       RegistryAddress = "127.0.0.1:2181"
+       ServerName      = "generic-server"
+       DubboServerPort = 20004
+)
+
+func main() {
+       hessian.RegisterPOJO(&pkg2.User{})
+
+       ins := createDubboInstance()
+
+       srv, err := ins.NewServer()
+       if err != nil {
+               logger.Fatalf("Failed to create server: %v", err)
+       }
+
+       registerService(srv, &pkg2.UserProvider{})
+
+       go func() {
+               logger.Info("Starting Dubbo Protocol Server...")
+               if err := srv.Serve(); err != nil {
+                       logger.Errorf("Dubbo server failed: %v", err)
+               }
+       }()
+
+       waitForShutdown()
+}
+
+func createDubboInstance() *dubbo.Instance {
+       ins, err := dubbo.NewInstance(
+               dubbo.WithName(ServerName),
+               dubbo.WithRegistry(
+                       registry.WithZookeeper(),
+                       registry.WithAddress(RegistryAddress),
+               ),
+               dubbo.WithProtocol(
+                       protocol.WithID("dubbo"),
+                       protocol.WithDubbo(),
+                       protocol.WithPort(DubboServerPort),
+               ),
+       )
+       if err != nil {
+               logger.Fatalf("Failed to create instance: %v", err)
+       }
+       return ins
+}
+
+func registerService(srv *server.Server, service *pkg2.UserProvider) {
+       serviceInfo := &common.ServiceInfo{
+               InterfaceName: "org.apache.dubbo.samples.UserProvider",
+               ServiceType:   service,
+               Methods: []common.MethodInfo{
+                       {Name: "GetUser1", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"java.lang.String"}}},
+                       {Name: "GetUser2", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"java.lang.String", 
"java.lang.String"}}},
+                       {Name: "GetUser3", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"int"}}},
+                       {Name: "GetUser4", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"int", "java.lang.String"}}},
+                       {Name: "GetOneUser", Type: "normal", Meta: 
map[string]interface{}{"params": []string{}}},
+
+                       {Name: "GetUsers", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"[Ljava.lang.String;"}}},
+                       {Name: "GetUsersMap", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"[Ljava.lang.String;"}}},
+
+                       {Name: "QueryUser", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"org.apache.dubbo.samples.User"}}},
+                       {Name: "QueryUsers", Type: "normal", Meta: 
map[string]interface{}{"params": []string{"[]org.apache.dubbo.samples.User"}}},
+                       {Name: "QueryAll", Type: "normal", Meta: 
map[string]interface{}{"params": []string{}}},
+               },
+               Meta: map[string]interface{}{
+                       "version":  "1.0.0",
+                       "group":    "dubbo",
+                       "protocol": "dubbo",
+               },
+       }
+
+       serviceOpts := []server.ServiceOption{
+               server.WithInterface("org.apache.dubbo.samples.UserProvider"),
+               server.WithVersion("1.0.0"),
+               server.WithGroup("dubbo"),
+               server.WithProtocolIDs([]string{"dubbo"}),
+       }
+
+       if err := srv.Register(service, serviceInfo, serviceOpts...); err != 
nil {
+               logger.Fatalf("Failed to register Dubbo service: %v", err)
+       }
+}
+
+func waitForShutdown() {
+       sigChan := make(chan os.Signal, 1)
+       signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM, syscall.SIGHUP, 
syscall.SIGQUIT)
+       sig := <-sigChan
+       logger.Infof("Received signal: %s, shutting down...", sig.String())
+       os.Exit(0)
+}
diff --git a/generic/go-server/pkg/init.go b/generic/go-server/pkg/init.go
new file mode 100644
index 00000000..205f031e
--- /dev/null
+++ b/generic/go-server/pkg/init.go
@@ -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.
+ */
+
+package pkg
+
+import (
+       hessian "github.com/apache/dubbo-go-hessian2"
+)
+
+func init() {
+       // register POJO
+       hessian.RegisterPOJO(&User{})
+       hessian.RegisterPOJO(&UserResponse{})
+}
diff --git a/generic/go-server/pkg/user.go b/generic/go-server/pkg/user.go
new file mode 100644
index 00000000..9128b71a
--- /dev/null
+++ b/generic/go-server/pkg/user.go
@@ -0,0 +1,40 @@
+/*
+ * 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 pkg
+
+import (
+       "time"
+)
+
+var userMap = map[string]*User{
+       "001": {"001", "other-zhangsan", 23, time.Date(1998, 1, 2, 3, 4, 5, 0, 
time.Local)},
+       "002": {"002", "other-lisi", 25, time.Date(1996, 1, 2, 3, 4, 5, 0, 
time.Local)},
+       "003": {"003", "other-lily", 28, time.Date(1993, 1, 2, 3, 4, 5, 0, 
time.Local)},
+       "004": {"004", "other-lisa", 36, time.Date(1985, 1, 2, 3, 4, 5, 0, 
time.Local)},
+}
+
+type User struct {
+       ID   string
+       Name string
+       Age  int32
+       Time time.Time
+}
+
+func (u *User) JavaClassName() string {
+       return "org.apache.dubbo.samples.User"
+}
diff --git a/generic/go-server/pkg/user_provider.go 
b/generic/go-server/pkg/user_provider.go
new file mode 100644
index 00000000..8ed4445d
--- /dev/null
+++ b/generic/go-server/pkg/user_provider.go
@@ -0,0 +1,118 @@
+/*
+ * 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 pkg
+
+import (
+       "context"
+       "strconv"
+       "time"
+)
+
+import (
+       "github.com/dubbogo/gost/log/logger"
+)
+
+type UserProvider struct{}
+
+func (u *UserProvider) GetUser1(_ context.Context, userID string) (*User, 
error) {
+       logger.Infof("req:%#v", userID)
+       rsp := User{userID, "Joe", 48, time.Now()}
+       logger.Infof("rsp:%#v", rsp)
+       return &rsp, nil
+}
+
+func (u *UserProvider) GetUser2(_ context.Context, userID string, name string) 
(*User, error) {
+       logger.Infof("req:%#v, %#v", userID, name)
+       rsp := User{userID, name, 48, time.Now()}
+       logger.Infof("rsp:%#v", rsp)
+       return &rsp, nil
+}
+
+func (u *UserProvider) GetUser3(_ context.Context, userCode int32) (*User, 
error) {
+       logger.Infof("req:%#v", userCode)
+       rsp := User{strconv.Itoa(int(userCode)), "Alex Stocks", 18, time.Now()}
+       logger.Infof("rsp:%#v", rsp)
+       return &rsp, nil
+}
+
+func (u *UserProvider) GetUser4(_ context.Context, userCode int32, name 
string) (*User, error) {
+       logger.Infof("req:%#v, %#v", userCode, name)
+       rsp := User{strconv.Itoa(int(userCode)), name, 18, time.Now()}
+       logger.Infof("rsp:%#v", rsp)
+       return &rsp, nil
+}
+
+func (u *UserProvider) GetOneUser(_ context.Context) (*User, error) {
+       return &User{
+               ID:   "1000",
+               Name: "xavierniu",
+               Age:  24,
+               Time: time.Now(),
+       }, nil
+}
+
+func (u *UserProvider) GetUsers(_ context.Context, userIdList []string) 
([]*User, error) {
+       logger.Infof("req:%#v", userIdList)
+       var users []*User
+       for _, i := range userIdList {
+               if v, ok := userMap[i]; ok {
+                       users = append(users, v)
+               } else {
+                       users = append(users, &User{ID: i, Name: "Unknown"})
+               }
+       }
+       return users, nil
+}
+
+func (u *UserProvider) GetUsersMap(_ context.Context, userIdList []string) 
(map[string]*User, error) {
+       logger.Infof("req:%#v", userIdList)
+       var users = make(map[string]*User)
+       for _, i := range userIdList {
+               if v, ok := userMap[i]; ok {
+                       users[i] = v
+               }
+       }
+       return users, nil
+}
+
+func (u *UserProvider) QueryUser(_ context.Context, user *User) (*User, error) 
{
+       logger.Infof("req1:%#v", user)
+       rsp := User{user.ID, user.Name, user.Age, time.Now()}
+       logger.Infof("rsp1:%#v", rsp)
+       return &rsp, nil
+}
+
+func (u *UserProvider) QueryUsers(_ context.Context, users []*User) ([]*User, 
error) {
+       return users, nil
+}
+
+func (u *UserProvider) QueryAll(_ context.Context) (map[string]*User, error) {
+       users := map[string]*User{
+               "001": {ID: "001", Name: "Joe", Age: 18, Time: time.Now()},
+               "002": {ID: "002", Name: "Wen", Age: 20, Time: time.Now()},
+       }
+       return users, nil
+}
+
+func (u *UserProvider) Reference() string {
+       return "org.apache.dubbo.samples.UserProvider"
+}
+
+func (u *UserProvider) MethodMapper(_ context.Context) map[string]string {
+       return map[string]string{}
+}
diff --git a/generic/go-server/pkg/user_response.go 
b/generic/go-server/pkg/user_response.go
new file mode 100644
index 00000000..3d7a3c90
--- /dev/null
+++ b/generic/go-server/pkg/user_response.go
@@ -0,0 +1,26 @@
+/*
+ * 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 pkg
+
+type UserResponse struct {
+       Users []*User
+}
+
+func (u *UserResponse) JavaClassName() string {
+       return "org.apache.dubbo.samples.UserResponse"
+}
diff --git a/generic/java-client/java-client/dependency-reduced-pom.xml 
b/generic/java-client/java-client/dependency-reduced-pom.xml
new file mode 100644
index 00000000..dc9e1d3e
--- /dev/null
+++ b/generic/java-client/java-client/dependency-reduced-pom.xml
@@ -0,0 +1,188 @@
+<?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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.dubbo</groupId>
+  <artifactId>generic-dubbo-java-client</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <extensions>
+      <extension>
+        <groupId>kr.motd.maven</groupId>
+        <artifactId>os-maven-plugin</artifactId>
+        <version>1.6.1</version>
+      </extension>
+    </extensions>
+    <plugins>
+      <plugin>
+        <groupId>org.xolstice.maven.plugins</groupId>
+        <artifactId>protobuf-maven-plugin</artifactId>
+        <version>0.6.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>compile</goal>
+              <goal>test-compile</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          
<protocArtifact>com.google.protobuf:protoc:3.17.3:exe:${os.detected.classifier}</protocArtifact>
+          <pluginId>triple-java</pluginId>
+          
<outputDirectory>build/generated/source/proto/main/java</outputDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>${maven-compiler-plugin.version}</version>
+        <configuration>
+          <source>${source.level}</source>
+          <target>${target.level}</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>build/generated/source/proto/main/java</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.4</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer>
+                  <mainClass>org.apache.dubbo.samples.ApiConsumer</mainClass>
+                </transformer>
+              </transformers>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <profiles>
+    <profile>
+      <id>javax.annotation</id>
+      <dependencies>
+        <dependency>
+          <groupId>javax.annotation</groupId>
+          <artifactId>javax.annotation-api</artifactId>
+          <version>1.3.2</version>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.dubbo</groupId>
+      <artifactId>dubbo-dependencies-zookeeper</artifactId>
+      <version>3.2.0</version>
+      <type>pom</type>
+      <scope>compile</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>zookeeper</artifactId>
+          <groupId>org.apache.zookeeper</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.13.1</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>hamcrest-core</artifactId>
+          <groupId>org.hamcrest</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <version>4.3.16.RELEASE</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.testcontainers</groupId>
+      <artifactId>testcontainers</artifactId>
+      <version>1.12.3</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>annotations</artifactId>
+          <groupId>org.jetbrains</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>javax.annotation-api</artifactId>
+          <groupId>javax.annotation</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>commons-compress</artifactId>
+          <groupId>org.apache.commons</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>jaxb-api</artifactId>
+          <groupId>javax.xml.bind</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>duct-tape</artifactId>
+          <groupId>org.rnorth.duct-tape</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>visible-assertions</artifactId>
+          <groupId>org.rnorth.visible-assertions</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>tcp-unix-socket-proxy</artifactId>
+          <groupId>org.rnorth</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>jna-platform</artifactId>
+          <groupId>net.java.dev.jna</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+  </dependencies>
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.dubbo</groupId>
+        <artifactId>dubbo-dependencies-bom</artifactId>
+        <version>${dubbo.version}</version>
+        <type>pom</type>
+        <scope>import</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+  <properties>
+    <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
+    <junit.version>4.13.1</junit.version>
+    <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+    <spring-boot.version>1.5.13.RELEASE</spring-boot.version>
+    <grpc.version>1.19.0</grpc.version>
+    <source.level>1.8</source.level>
+    <spring-test.version>4.3.16.RELEASE</spring-test.version>
+    <target.level>1.8</target.level>
+    <dubbo.version>3.2.0</dubbo.version>
+    <protoc.version>3.7.1</protoc.version>
+  </properties>
+</project>
diff --git a/generic/java-client/java-client/pom.xml 
b/generic/java-client/java-client/pom.xml
new file mode 100644
index 00000000..dfe38864
--- /dev/null
+++ b/generic/java-client/java-client/pom.xml
@@ -0,0 +1,194 @@
+<?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 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.dubbo</groupId>
+    <version>1.0-SNAPSHOT</version>
+    <artifactId>generic-dubbo-java-client</artifactId>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.dubbo</groupId>
+                <artifactId>dubbo-dependencies-bom</artifactId>
+                <version>${dubbo.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <properties>
+        <source.level>1.8</source.level>
+        <target.level>1.8</target.level>
+        <dubbo.version>3.2.0</dubbo.version>
+        <junit.version>4.13.1</junit.version>
+        <spring-test.version>4.3.16.RELEASE</spring-test.version>
+        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+        <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
+        <spring-boot.version>1.5.13.RELEASE</spring-boot.version>
+        <grpc.version>1.19.0</grpc.version>
+        <protoc.version>3.7.1</protoc.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo</artifactId>
+            <version>${dubbo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.16.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo-dependencies-zookeeper</artifactId>
+            <version>${dubbo.version}</version>
+            <type>pom</type>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.zookeeper</groupId>
+                    <artifactId>zookeeper</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper</artifactId>
+            <version>3.4.14</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>${spring-test.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>testcontainers</artifactId>
+            <version>1.12.3</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <!-- For jdk 11 above JavaEE annotation -->
+        <profile>
+            <id>javax.annotation</id>
+            <activation>
+                <jdk>[1.11,)</jdk>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.annotation</groupId>
+                    <artifactId>javax.annotation-api</artifactId>
+                    <version>1.3.2</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+    <build>
+        <extensions>
+            <extension>
+                <groupId>kr.motd.maven</groupId>
+                <artifactId>os-maven-plugin</artifactId>
+                <version>1.6.1</version>
+            </extension>
+        </extensions>
+        <plugins>
+            <plugin>
+                <groupId>org.xolstice.maven.plugins</groupId>
+                <artifactId>protobuf-maven-plugin</artifactId>
+                <version>0.6.1</version>
+                <configuration>
+                    
<protocArtifact>com.google.protobuf:protoc:3.17.3:exe:${os.detected.classifier}</protocArtifact>
+                    <pluginId>triple-java</pluginId>
+                    
<outputDirectory>build/generated/source/proto/main/java</outputDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>test-compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven-compiler-plugin.version}</version>
+                <configuration>
+                    <source>${source.level}</source>
+                    <target>${target.level}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                
<source>build/generated/source/proto/main/java</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.2.4</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    
<mainClass>org.apache.dubbo.samples.ApiConsumer</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file
diff --git a/generic/java-client/java-client/run.sh 
b/generic/java-client/java-client/run.sh
new file mode 100755
index 00000000..175f47b2
--- /dev/null
+++ b/generic/java-client/java-client/run.sh
@@ -0,0 +1 @@
+mvn -e clean package && java -jar 
target/generic-dubbo-java-client-1.0-SNAPSHOT.jar
\ No newline at end of file
diff --git 
a/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/ApiConsumer.java
 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/ApiConsumer.java
new file mode 100644
index 00000000..fe2147f8
--- /dev/null
+++ 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/ApiConsumer.java
@@ -0,0 +1,75 @@
+/*
+ * 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;
+
+import org.apache.dubbo.config.ProtocolConfig;
+import org.apache.dubbo.config.ReferenceConfig;
+import org.apache.dubbo.config.RegistryConfig;
+import org.apache.dubbo.config.bootstrap.DubboBootstrap;
+
+public class ApiConsumer {
+    public static void main(String[] args) {
+        DubboBootstrap bootstrap = DubboBootstrap.getInstance();
+
+        RegistryConfig registryConfig = new 
RegistryConfig("zookeeper://127.0.0.1:2181");
+        ProtocolConfig protocolConfig = new ProtocolConfig("dubbo");
+
+        bootstrap.application("generic-dubbo-client")
+                .registry(registryConfig)
+                .protocol(protocolConfig)
+                .start();
+
+        ReferenceConfig<UserProvider> reference = new ReferenceConfig<>();
+        reference.setInterface(UserProvider.class);
+        reference.setGroup("dubbo");
+        reference.setVersion("1.0.0");
+        reference.setGeneric("false");
+
+        UserProvider userProvider = reference.get();
+
+        System.out.println("\n=== Testing Dubbo Protocol ===");
+
+        callGetUser(userProvider);
+        callGetOneUser(userProvider);
+        callGetUsers(userProvider);
+        callGetUsersMap(userProvider);
+    }
+
+    private static void callGetUser(UserProvider userProvider) {
+        System.out.println("GetUser1(String userId) res: " + 
userProvider.GetUser1("A003"));
+        System.out.println("GetUser2(String userId, String name) res: " + 
userProvider.GetUser2("A003", "lily"));
+        System.out.println("GetUser3(int userCode) res: " + 
userProvider.GetUser3(1));
+        System.out.println("GetUser4(int userCode, String name) res: " + 
userProvider.GetUser4(1, "zhangsan"));
+    }
+
+    private static void callGetOneUser(UserProvider userProvider) {
+        System.out.println("GetOneUser() res: " + userProvider.GetOneUser());
+    }
+
+    private static void callGetUsers(UserProvider userProvider) {
+        System.out.println("Call GetUsers");
+        String[] userIds = new String[]{"001", "002"};
+        System.out.println("GetUsers res: " + userProvider.GetUsers(userIds));
+    }
+
+    private static void callGetUsersMap(UserProvider userProvider) {
+        System.out.println("Call GetUsersMap");
+        String[] userIds = new String[]{"001", "002"};
+        System.out.println("GetUsersMap res: " + 
userProvider.GetUsersMap(userIds));
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/Gender.java
 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/Gender.java
new file mode 100644
index 00000000..a0383fba
--- /dev/null
+++ 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/Gender.java
@@ -0,0 +1,23 @@
+/*
+ * 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;
+
+public enum Gender {
+    MAN,
+    WOMAN
+}
diff --git 
a/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/Response.java
 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/Response.java
new file mode 100644
index 00000000..8d2cf801
--- /dev/null
+++ 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/Response.java
@@ -0,0 +1,92 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+public final class Response<T> implements Serializable {
+    private static final long serialVersionUID = 3727205004706510648L;
+    public static final Integer OK = 200;
+    public static final Integer ERR = 500;
+    private Integer Status;
+    private String Err;
+    private T Data;
+
+    public Response() {
+    }
+
+    public static <T> Response<T> ok() {
+        Response r = new Response();
+        r.Status = OK;
+        return r;
+    }
+
+    public static <T> Response<T> ok(Object Data) {
+        Response r = new Response();
+        r.Status = OK;
+        r.Data = Data;
+        return r;
+    }
+
+    public static <T> Response<T> notOk(String Err) {
+        Response r = new Response();
+        r.Status = ERR;
+        r.Err = Err;
+        return r;
+    }
+
+    public static <T> Response<T> notOk(Integer Status, String Err) {
+        Response r = new Response();
+        r.Status = Status;
+        r.Err = Err;
+        return r;
+    }
+
+//    public Boolean isSuccess() {
+//        return Objects.equals(this.Status, OK);
+//    }
+
+    public Integer getStatus() {
+        return this.Status;
+    }
+
+    public void setStatus(Integer Status) {
+        this.Status = Status;
+    }
+
+    public String getErr() {
+        return this.Err;
+    }
+
+    public void setErr(String Err) {
+        this.Err = Err;
+    }
+
+    public T getData() {
+        return this.Data;
+    }
+
+    public void setData(T Data) {
+        this.Status = OK;
+        this.Data = Data;
+    }
+
+    public String toString() {
+        return "Response{Status=" + this.Status + ", Err='" + this.Err + '\'' 
+ ", Data=" + this.Data + '}';
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/User.java
 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/User.java
new file mode 100644
index 00000000..d649743b
--- /dev/null
+++ 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/User.java
@@ -0,0 +1,90 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class User implements Serializable {
+    private String id;
+    private String name;
+    private int age;
+    private Date time = new Date();
+    private Gender sex = Gender.MAN;
+
+    public User() {
+    }
+
+    public User(String id, String name, int age) {
+        this.id = id;
+        this.name = name;
+        this.age = age;
+    }
+
+    public User(String id, String name, int age, Date time, Gender sex) {
+        this.id = id;
+        this.name = name;
+        this.age = age;
+        this.time = time;
+        this.sex = sex;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public Gender getSex() {
+        return sex;
+    }
+
+    public void setSex(Gender sex) {
+        this.sex = sex;
+    }
+
+    public String toString() {
+        return "User{id:" + id + ", name:" + name + ", age:" + age + ", time:" 
+ time + ", gender:" + sex + "}";
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/UserProvider.java
 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/UserProvider.java
new file mode 100644
index 00000000..eabcbda1
--- /dev/null
+++ 
b/generic/java-client/java-client/src/main/java/org/apache/dubbo/samples/UserProvider.java
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+import java.util.List;
+import java.util.Map;
+
+public interface UserProvider {
+    User GetUser1(String userId);
+    User GetUser2(String userId, String name);
+    User GetUser3(int userCode);
+    User GetUser4(int userCode, String name);
+    User GetOneUser();
+
+    List<User> GetUsers(String[] userIdList);
+    Map<String, User> GetUsersMap(String[] userIdList);
+
+    User QueryUser(User user);
+    List<User> QueryUsers(List<User> userObjectList);
+    Map<String, User> QueryAll();
+}
\ No newline at end of file
diff --git 
a/generic/java-client/java-client/src/main/resources/dubbo.properties 
b/generic/java-client/java-client/src/main/resources/dubbo.properties
new file mode 100644
index 00000000..bb1ce9c4
--- /dev/null
+++ b/generic/java-client/java-client/src/main/resources/dubbo.properties
@@ -0,0 +1,8 @@
+dubbo.application.name=generic-dubbo-client
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+dubbo.registry.subscribe-mode=application
+dubbo.reference.org.apache.dubbo.samples.UserProvider.application=generic-server
+dubbo.reference.org.apache.dubbo.samples.UserProvider.version=1.0.0
+dubbo.reference.org.apache.dubbo.samples.UserProvider.group=dubbo
+dubbo.reference.org.apache.dubbo.samples.UserProvider.protocol=dubbo
+dubbo.application.qos.port=22224
\ No newline at end of file
diff --git 
a/generic/java-client/java-client/src/main/resources/log4j.properties 
b/generic/java-client/java-client/src/main/resources/log4j.properties
new file mode 100644
index 00000000..06bcb344
--- /dev/null
+++ b/generic/java-client/java-client/src/main/resources/log4j.properties
@@ -0,0 +1,19 @@
+## Logger configure file for myproject
+log.dir=logs/
+datestamp=yyyy-MM-dd/HH:mm:ss.SSS
+
+log4j.rootLogger=DEBUG, file, console
+
+log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.file.threshold=DEBUG
+log4j.appender.file.File=${log.dir}/log4j.log
+log4j.appender.file.DatePattern=-yyyyMMddHH
+log4j.appender.file.ImmediateFlush=true
+log4j.appender.file.Append=true
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.Threshold=DEBUG
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
diff --git a/generic/java-server/java-server/dependency-reduced-pom.xml 
b/generic/java-server/java-server/dependency-reduced-pom.xml
new file mode 100644
index 00000000..a6c7c8c2
--- /dev/null
+++ b/generic/java-server/java-server/dependency-reduced-pom.xml
@@ -0,0 +1,178 @@
+<?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/maven-v4_0_0.xsd";>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.dubbo</groupId>
+  <artifactId>generic-dubbo-java-server</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <build>
+    <extensions>
+      <extension>
+        <groupId>kr.motd.maven</groupId>
+        <artifactId>os-maven-plugin</artifactId>
+        <version>1.6.1</version>
+      </extension>
+    </extensions>
+    <defaultGoal>package</defaultGoal>
+    <plugins>
+      <plugin>
+        <groupId>org.xolstice.maven.plugins</groupId>
+        <artifactId>protobuf-maven-plugin</artifactId>
+        <version>0.6.1</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>compile</goal>
+              <goal>test-compile</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          
<protocArtifact>com.google.protobuf:protoc:3.17.3:exe:${os.detected.classifier}</protocArtifact>
+          <pluginId>triple-java</pluginId>
+          
<outputDirectory>build/generated/source/proto/main/java</outputDirectory>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>${maven-compiler-plugin.version}</version>
+        <configuration>
+          <source>${source.level}</source>
+          <target>${target.level}</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>build-helper-maven-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>add-source</goal>
+            </goals>
+            <configuration>
+              <sources>
+                <source>build/generated/source/proto/main/java</source>
+              </sources>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.4</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer>
+                  <mainClass>org.apache.dubbo.samples.ApiProvider</mainClass>
+                </transformer>
+              </transformers>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <profiles>
+    <profile>
+      <id>javax.annotation</id>
+      <dependencies>
+        <dependency>
+          <groupId>javax.annotation</groupId>
+          <artifactId>javax.annotation-api</artifactId>
+          <version>1.3.2</version>
+        </dependency>
+      </dependencies>
+    </profile>
+  </profiles>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.dubbo</groupId>
+      <artifactId>dubbo-dependencies-zookeeper</artifactId>
+      <version>3.0.12</version>
+      <type>pom</type>
+      <scope>compile</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>zookeeper</artifactId>
+          <groupId>org.apache.zookeeper</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.13.1</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>hamcrest-core</artifactId>
+          <groupId>org.hamcrest</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-test</artifactId>
+      <version>4.3.16.RELEASE</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.testcontainers</groupId>
+      <artifactId>testcontainers</artifactId>
+      <version>1.12.3</version>
+      <scope>test</scope>
+      <exclusions>
+        <exclusion>
+          <artifactId>annotations</artifactId>
+          <groupId>org.jetbrains</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>javax.annotation-api</artifactId>
+          <groupId>javax.annotation</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>commons-compress</artifactId>
+          <groupId>org.apache.commons</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>jaxb-api</artifactId>
+          <groupId>javax.xml.bind</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>duct-tape</artifactId>
+          <groupId>org.rnorth.duct-tape</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>visible-assertions</artifactId>
+          <groupId>org.rnorth.visible-assertions</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>tcp-unix-socket-proxy</artifactId>
+          <groupId>org.rnorth</groupId>
+        </exclusion>
+        <exclusion>
+          <artifactId>jna-platform</artifactId>
+          <groupId>net.java.dev.jna</groupId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+  </dependencies>
+  <properties>
+    <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
+    <junit.version>4.13.1</junit.version>
+    <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+    <spring-boot.version>1.5.13.RELEASE</spring-boot.version>
+    <grpc.version>1.19.0</grpc.version>
+    <source.level>1.8</source.level>
+    <spring-test.version>4.3.16.RELEASE</spring-test.version>
+    <target.level>1.8</target.level>
+    <dubbo.version>3.0.12</dubbo.version>
+    <protoc.version>3.7.1</protoc.version>
+  </properties>
+</project>
diff --git a/generic/java-server/java-server/pom.xml 
b/generic/java-server/java-server/pom.xml
new file mode 100644
index 00000000..ae6ed1cd
--- /dev/null
+++ b/generic/java-server/java-server/pom.xml
@@ -0,0 +1,184 @@
+<?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 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.dubbo</groupId>
+    <version>1.0-SNAPSHOT</version>
+    <artifactId>generic-dubbo-java-server</artifactId>
+
+    <properties>
+        <source.level>1.8</source.level>
+        <target.level>1.8</target.level>
+        <dubbo.version>3.0.12</dubbo.version>
+        <junit.version>4.13.1</junit.version>
+        <spring-test.version>4.3.16.RELEASE</spring-test.version>
+        <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
+        <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
+        <spring-boot.version>1.5.13.RELEASE</spring-boot.version>
+        <grpc.version>1.19.0</grpc.version>
+        <protoc.version>3.7.1</protoc.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo</artifactId>
+            <version>${dubbo.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.google.protobuf</groupId>
+            <artifactId>protobuf-java</artifactId>
+            <version>3.16.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.dubbo</groupId>
+            <artifactId>dubbo-dependencies-zookeeper</artifactId>
+            <version>${dubbo.version}</version>
+            <type>pom</type>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.zookeeper</groupId>
+                    <artifactId>zookeeper</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.zookeeper</groupId>
+            <artifactId>zookeeper</artifactId>
+            <version>3.4.14</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>${junit.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-test</artifactId>
+            <version>${spring-test.version}</version>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.testcontainers</groupId>
+            <artifactId>testcontainers</artifactId>
+            <version>1.12.3</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <profiles>
+        <!-- For jdk 11 above JavaEE annotation -->
+        <profile>
+            <id>javax.annotation</id>
+            <activation>
+                <jdk>[1.11,)</jdk>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>javax.annotation</groupId>
+                    <artifactId>javax.annotation-api</artifactId>
+                    <version>1.3.2</version>
+                </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+
+    <build>
+        <defaultGoal>package</defaultGoal>
+        <extensions>
+            <extension>
+                <groupId>kr.motd.maven</groupId>
+                <artifactId>os-maven-plugin</artifactId>
+                <version>1.6.1</version>
+            </extension>
+        </extensions>
+
+        <plugins>
+            <plugin>
+                <groupId>org.xolstice.maven.plugins</groupId>
+                <artifactId>protobuf-maven-plugin</artifactId>
+                <version>0.6.1</version>
+                <configuration>
+                    
<protocArtifact>com.google.protobuf:protoc:3.17.3:exe:${os.detected.classifier}</protocArtifact>
+                    <pluginId>triple-java</pluginId>
+                    
<outputDirectory>build/generated/source/proto/main/java</outputDirectory>
+                </configuration>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>compile</goal>
+                            <goal>test-compile</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven-compiler-plugin.version}</version>
+                <configuration>
+                    <source>${source.level}</source>
+                    <target>${target.level}</target>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>generate-sources</phase>
+                        <goals>
+                            <goal>add-source</goal>
+                        </goals>
+                        <configuration>
+                            <sources>
+                                
<source>build/generated/source/proto/main/java</source>
+                            </sources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <version>3.2.4</version>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>shade</goal>
+                        </goals>
+                        <configuration>
+                            <transformers>
+                                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    
<mainClass>org.apache.dubbo.samples.ApiProvider</mainClass>
+                                </transformer>
+                            </transformers>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file
diff --git a/generic/java-server/java-server/run.sh 
b/generic/java-server/java-server/run.sh
new file mode 100755
index 00000000..a50c1e5e
--- /dev/null
+++ b/generic/java-server/java-server/run.sh
@@ -0,0 +1 @@
+mvn -e clean package && java -jar 
target/generic-dubbo-java-server-1.0-SNAPSHOT.jar
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/ApiProvider.java
 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/ApiProvider.java
new file mode 100644
index 00000000..98069d66
--- /dev/null
+++ 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/ApiProvider.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;
+
+import org.apache.dubbo.config.ServiceConfig;
+import org.apache.dubbo.config.bootstrap.DubboBootstrap;
+
+import java.util.concurrent.CountDownLatch;
+
+public class ApiProvider {
+    public static void main(String[] args) throws InterruptedException {
+        DubboBootstrap bootstrap = DubboBootstrap.getInstance();
+
+        ServiceConfig<UserProvider> service = new ServiceConfig<>();
+        service.setInterface(UserProvider.class);
+        service.setRef(new UserProviderImpl());
+        service.setGroup("dubbo");
+        service.setVersion("1.0.0");
+
+        bootstrap.service(service);
+
+        bootstrap.start();
+        System.out.println("dubbo service started");
+        new CountDownLatch(1).await();
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/Gender.java
 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/Gender.java
new file mode 100644
index 00000000..a0383fba
--- /dev/null
+++ 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/Gender.java
@@ -0,0 +1,23 @@
+/*
+ * 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;
+
+public enum Gender {
+    MAN,
+    WOMAN
+}
diff --git 
a/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/Response.java
 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/Response.java
new file mode 100644
index 00000000..8d2cf801
--- /dev/null
+++ 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/Response.java
@@ -0,0 +1,92 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+
+public final class Response<T> implements Serializable {
+    private static final long serialVersionUID = 3727205004706510648L;
+    public static final Integer OK = 200;
+    public static final Integer ERR = 500;
+    private Integer Status;
+    private String Err;
+    private T Data;
+
+    public Response() {
+    }
+
+    public static <T> Response<T> ok() {
+        Response r = new Response();
+        r.Status = OK;
+        return r;
+    }
+
+    public static <T> Response<T> ok(Object Data) {
+        Response r = new Response();
+        r.Status = OK;
+        r.Data = Data;
+        return r;
+    }
+
+    public static <T> Response<T> notOk(String Err) {
+        Response r = new Response();
+        r.Status = ERR;
+        r.Err = Err;
+        return r;
+    }
+
+    public static <T> Response<T> notOk(Integer Status, String Err) {
+        Response r = new Response();
+        r.Status = Status;
+        r.Err = Err;
+        return r;
+    }
+
+//    public Boolean isSuccess() {
+//        return Objects.equals(this.Status, OK);
+//    }
+
+    public Integer getStatus() {
+        return this.Status;
+    }
+
+    public void setStatus(Integer Status) {
+        this.Status = Status;
+    }
+
+    public String getErr() {
+        return this.Err;
+    }
+
+    public void setErr(String Err) {
+        this.Err = Err;
+    }
+
+    public T getData() {
+        return this.Data;
+    }
+
+    public void setData(T Data) {
+        this.Status = OK;
+        this.Data = Data;
+    }
+
+    public String toString() {
+        return "Response{Status=" + this.Status + ", Err='" + this.Err + '\'' 
+ ", Data=" + this.Data + '}';
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/User.java
 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/User.java
new file mode 100644
index 00000000..d649743b
--- /dev/null
+++ 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/User.java
@@ -0,0 +1,90 @@
+/*
+ * 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;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class User implements Serializable {
+    private String id;
+    private String name;
+    private int age;
+    private Date time = new Date();
+    private Gender sex = Gender.MAN;
+
+    public User() {
+    }
+
+    public User(String id, String name, int age) {
+        this.id = id;
+        this.name = name;
+        this.age = age;
+    }
+
+    public User(String id, String name, int age, Date time, Gender sex) {
+        this.id = id;
+        this.name = name;
+        this.age = age;
+        this.time = time;
+        this.sex = sex;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public int getAge() {
+        return age;
+    }
+
+    public void setAge(int age) {
+        this.age = age;
+    }
+
+    public Date getTime() {
+        return time;
+    }
+
+    public void setTime(Date time) {
+        this.time = time;
+    }
+
+    public Gender getSex() {
+        return sex;
+    }
+
+    public void setSex(Gender sex) {
+        this.sex = sex;
+    }
+
+    public String toString() {
+        return "User{id:" + id + ", name:" + name + ", age:" + age + ", time:" 
+ time + ", gender:" + sex + "}";
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/UserProvider.java
 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/UserProvider.java
new file mode 100644
index 00000000..1c71776b
--- /dev/null
+++ 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/UserProvider.java
@@ -0,0 +1,44 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public interface UserProvider {
+    User GetUser1(String userId);
+
+    User GetUser2(String userId, String name);
+
+    User GetUser3(int userCode);
+
+    User GetUser4(int userCode, String name);
+
+    User GetOneUser();
+
+    List<User> GetUsers(String[] userIdList);
+
+    Map<String, User> GetUsersMap(String[] userIdList);
+
+    User QueryUser(User user);
+
+    List<User> QueryUsers(List<User> userObjectList);
+
+    Map<String, User> QueryAll();
+}
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/UserProviderImpl.java
 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/UserProviderImpl.java
new file mode 100644
index 00000000..28159675
--- /dev/null
+++ 
b/generic/java-server/java-server/src/main/java/org/apache/dubbo/samples/UserProviderImpl.java
@@ -0,0 +1,106 @@
+/*
+ * 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;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+
+public class UserProviderImpl implements UserProvider {
+    private static final Logger LOG = LoggerFactory.getLogger("userLogger");
+    private Map<String, User> userMap = new HashMap<String, User>();
+
+    UserProviderImpl() {
+        userMap.put("001", new User("001", "other-zhangsan", 23, new 
Date(1998, 1, 2, 3, 4, 5), Gender.MAN));
+        userMap.put("002", new User("002", "other-lisi", 25, new Date(1996, 1, 
2, 3, 4, 5), Gender.MAN));
+        userMap.put("003", new User("003", "other-lily", 28, new Date(1993, 1, 
2, 3, 4, 5), Gender.WOMAN));
+        userMap.put("004", new User("004", "other-lisa", 36, new Date(1985, 1, 
2, 3, 4, 5), Gender.WOMAN));
+    }
+
+    public User GetUser1(String userId) {
+        LOG.info("req:" + userId);
+        User rsp = new User(userId, "Joe", 48, new Date(), Gender.MAN);
+        LOG.info("rsp:" + rsp);
+        return rsp;
+    }
+
+    public User GetUser2(String userId, String name) {
+        LOG.info("req:" + userId + ", " + name);
+        User rsp = new User(userId, name, 48, new Date(), Gender.MAN);
+        LOG.info("rsp:" + rsp);
+        return rsp;
+    }
+
+    public User GetUser3(int userCode) {
+        LOG.info("req:" + userCode);
+        User rsp = new User(String.valueOf(userCode), "Alex Stocks", 18, new 
Date(), Gender.MAN);
+        LOG.info("rsp:" + rsp);
+        return rsp;
+    }
+
+    public User GetUser4(int userCode, String name) {
+        LOG.info("req:" + userCode + ", " + name);
+        User rsp = new User(String.valueOf(userCode), name, 18, new Date(), 
Gender.MAN);
+        LOG.info("rsp:" + rsp);
+        return rsp;
+    }
+
+    public User GetOneUser() {
+        return new User("1000", "xavierniu", 24, new Date(), Gender.MAN);
+    }
+
+    @Override
+    public List<User> GetUsers(String[] userIdList) {
+        LOG.info("req:" + Arrays.toString(userIdList));
+        List<User> userList = new ArrayList<User>();
+        for (String i : userIdList) {
+            userList.add(userMap.get(i));
+        }
+        return userList;
+    }
+
+    @Override
+    public Map<String, User> GetUsersMap(String[] userIdList) {
+        LOG.info("req:" + Arrays.toString(userIdList));
+        Map<String, User> users = new HashMap<String, User>();
+        for (String i : userIdList) {
+            users.put(i, userMap.get(i));
+        }
+        return users;
+    }
+
+    public User QueryUser(User user) {
+        LOG.info("req1:" + user);
+        User rsp = new User(user.getId(), user.getName(), user.getAge(), new 
Date(), user.getSex());
+        LOG.info("rsp1:" + rsp);
+        return rsp;
+    }
+
+    @Override
+    public List<User> QueryUsers(List<User> users) {
+        return users;
+    }
+
+    public Map<String, User> QueryAll() {
+        Map<String, User> users = new HashMap<String, User>();
+        users.put("001", new User("001", "Joe", 18, new Date(), Gender.MAN));
+        users.put("002", new User("002", "Wen", 20, new Date(), Gender.MAN));
+        return users;
+    }
+}
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/resources/dubbo.properties 
b/generic/java-server/java-server/src/main/resources/dubbo.properties
new file mode 100644
index 00000000..8c2bfa80
--- /dev/null
+++ b/generic/java-server/java-server/src/main/resources/dubbo.properties
@@ -0,0 +1,8 @@
+dubbo.application.name=generic-server
+dubbo.registry.address=zookeeper://127.0.0.1:2181
+dubbo.registry.register-mode=instance
+dubbo.protocol.name=dubbo
+dubbo.protocol.port=20004
+dubbo.service.org.apache.dubbo.UserProvider.version=1.0.0
+dubbo.service.org.apache.dubbo.UserProvider.group=dubbo
+dubbo.application.qos.port=22223
\ No newline at end of file
diff --git 
a/generic/java-server/java-server/src/main/resources/log4j.properties 
b/generic/java-server/java-server/src/main/resources/log4j.properties
new file mode 100644
index 00000000..806e33db
--- /dev/null
+++ b/generic/java-server/java-server/src/main/resources/log4j.properties
@@ -0,0 +1,20 @@
+## Logger configure file for myproject
+log.dir=logs/
+datestamp=yyyy-MM-dd/HH:mm:ss.SSS
+
+log4j.rootLogger=DEBUG, file, console
+
+log4j.appender.file=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.file.threshold=DEBUG
+log4j.appender.file.File=${log.dir}/log4j.log
+log4j.appender.file.DatePattern=-yyyyMMddHH
+log4j.appender.file.ImmediateFlush=true
+log4j.appender.file.Append=true
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
+
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.Threshold=DEBUG
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %l - %m%n
+
diff --git a/start_integrate_test.sh b/start_integrate_test.sh
index 9d8d1c5e..f1e6004e 100755
--- a/start_integrate_test.sh
+++ b/start_integrate_test.sh
@@ -43,8 +43,7 @@ array+=("filter/custom")
 array+=("registry/zookeeper")
 array+=("registry/nacos")
 
-# generic
-array+=("compatibility/generic/default")
+array+=("generic")
 
 #timeout
 array+=("timeout")


Reply via email to