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

hefengen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new f2b10010c6 supports pojo as rpc method paramete (#5112)
f2b10010c6 is described below

commit f2b10010c68cd0f8690753a045bcac54b3efefb0
Author: coderDylan <[email protected]>
AuthorDate: Wed Sep 6 21:13:32 2023 +0800

    supports pojo as rpc method paramete (#5112)
    
    * Multi-protocol support for motan rpc plugin
    
    * fixed for checkstyle
    
    * fixed ci
    
    * fixed ci
    
    * 1. Upgrade motan plugin, supports pojo as rpc method paramete
    2. Simplified plugin code, fixed POJO class loading failure exception
    3. Refine the sample code
    4. Found class load conflicts between shenyu plugins and added necessary 
prompts
    
    * Dependency prompt
    
    * Perfect example
    
    * fixed checkstyle
    
    * fixed checkstyle
    
    * fixed ci
    
    * fixed ci
    
    * fixed ci
    
    * fixed ci
    
    * fixed ci
    
    ---------
    
    Co-authored-by: lang_ding <[email protected]>
    Co-authored-by: coderDylan <[email protected]>
    Co-authored-by: xiaoyu <[email protected]>
    Co-authored-by: yunlongn <[email protected]>
    Co-authored-by: moremind <[email protected]>
---
 shenyu-bootstrap/pom.xml                           |   3 +
 .../src/main/resources/application.yml             |   2 +-
 .../shenyu-examples-motan-api/pom.xml              |   2 +-
 .../motan/service/MotanClassDemoService.java       |  17 +++
 .../shenyu/examples/motan/service/MotanTest.java   |  84 +++++++++++++
 .../src/main/http/motan-class-test-api.http        |  14 +++
 .../service/impl/MotanClassDemoServiceImpl.java    |  22 ++++
 .../plugin/motan/cache/ApplicationConfigCache.java | 132 ++++-----------------
 .../plugin/motan/proxy/MotanProxyService.java      |  29 ++---
 .../motan/cache/ApplicationConfigCacheTest.java    |  11 +-
 10 files changed, 178 insertions(+), 138 deletions(-)

diff --git a/shenyu-bootstrap/pom.xml b/shenyu-bootstrap/pom.xml
index 6ca507c6be..e99f2a0cf3 100644
--- a/shenyu-bootstrap/pom.xml
+++ b/shenyu-bootstrap/pom.xml
@@ -411,6 +411,9 @@
         <!-- shenyu spring cloud alibaba dubbo end-->
 
         <!--shenyu motan plugin start-->
+        <!--If you plan to use the motan plugin and want to use the hessian 
serialization,
+        please check the sofa plugin related dependencies.In particular, the 
reliance on sofa-hessian should be excluded.
+        Because sofa-hessian and caucho-hessian can cause class loading 
conflicts and cause some unexpected problems-->
         <dependency>
             <groupId>com.weibo</groupId>
             <artifactId>motan-core</artifactId>
diff --git 
a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/resources/application.yml
 
b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/resources/application.yml
index c912d8d668..1e0b6c4520 100644
--- 
a/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/resources/application.yml
+++ 
b/shenyu-examples/shenyu-examples-dubbo/shenyu-examples-apache-dubbo-service-annotation/src/main/resources/application.yml
@@ -39,7 +39,7 @@ dubbo:
   application:
     name: test-dubbo-service
   registry:
-    address: zookeeper://127.0.0.1:2181
+    address: nacos://127.0.0.1:8848
   protocol:
     name: dubbo
     port: 20888
diff --git 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/pom.xml 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/pom.xml
index eedeb18a10..bd4b2801ff 100644
--- a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/pom.xml
+++ b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/pom.xml
@@ -29,7 +29,7 @@
     <artifactId>shenyu-examples-motan-api</artifactId>
     
     <properties>
-        <motan.version>1.2.0</motan.version>
+        <motan.version>1.2.1</motan.version>
     </properties>
 
     <dependencies>
diff --git 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanClassDemoService.java
 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanClassDemoService.java
index e298fa6a03..c7a378abbe 100644
--- 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanClassDemoService.java
+++ 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanClassDemoService.java
@@ -19,6 +19,8 @@ package org.apache.shenyu.examples.motan.service;
 
 import com.weibo.api.motan.transport.async.MotanAsync;
 
+import java.util.List;
+
 /**
  * Motan class demo interface.
  */
@@ -38,4 +40,19 @@ public interface MotanClassDemoService {
      * @return  response
      */
     String testTimeOut(long seconds);
+
+    /**
+     * pojo as a parameter for test generalized call.
+     * @param motanTest pojo
+     * @return the motanTest
+     */
+    MotanTest save(MotanTest motanTest);
+
+    /**
+     * List pojo as a parameter for test generalized call.
+     * Unfortunately, motan doesn't support this right now.
+     * @param motanTestList pojo list
+     * @return the motanTest
+     */
+    MotanTest batchSave(List<MotanTest> motanTestList);
 }
diff --git 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanTest.java
 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanTest.java
new file mode 100644
index 0000000000..9bd3484f7a
--- /dev/null
+++ 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-api/src/main/java/org/apache/shenyu/examples/motan/service/MotanTest.java
@@ -0,0 +1,84 @@
+/*
+ * 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.shenyu.examples.motan.service;
+
+import java.io.Serializable;
+import java.util.StringJoiner;
+
+/**
+ * MotanTest.
+ */
+public class MotanTest implements Serializable {
+
+    private String id;
+
+    private String name;
+
+    public MotanTest() {
+    }
+
+    public MotanTest(final String id, final String name) {
+        this.id = id;
+        this.name = name;
+    }
+
+    /**
+     * Get id.
+     *
+     * @return id
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * Set id.
+     *
+     * @param id id
+     */
+    public void setId(final String id) {
+        this.id = id;
+    }
+
+    /**
+     * Get name.
+     *
+     * @return name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * Set name.
+     *
+     * @param name name
+     */
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+    @Override
+    public String toString() {
+        return new StringJoiner(", ", MotanTest.class.getSimpleName() + "[", 
"]")
+                .add("id='" + id + "'")
+                .add("name='" + name + "'")
+                .toString();
+    }
+
+}
diff --git 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/http/motan-class-test-api.http
 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/http/motan-class-test-api.http
index e7017da20e..6d88480021 100644
--- 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/http/motan-class-test-api.http
+++ 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/http/motan-class-test-api.http
@@ -33,3 +33,17 @@ Content-Type: application/json
 {
   "timeout": "1"
 }
+
+
+### shengyu getway proxy save
+POST http://localhost:9195/motan/demoTest/save
+Accept: application/json
+Content-Type: application/json
+
+{
+    "motanTest":
+        {
+            "id": "999",
+            "name": "dinglang"
+        }
+}
diff --git 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanClassDemoServiceImpl.java
 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanClassDemoServiceImpl.java
index a39b4ee1c0..51a28d5342 100644
--- 
a/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanClassDemoServiceImpl.java
+++ 
b/shenyu-examples/shenyu-examples-motan/shenyu-examples-motan-service/src/main/java/org/apache/shenyu/examples/motan/service/impl/MotanClassDemoServiceImpl.java
@@ -19,7 +19,13 @@ package org.apache.shenyu.examples.motan.service.impl;
 
 import org.apache.shenyu.client.motan.common.annotation.ShenyuMotanService;
 import org.apache.shenyu.examples.motan.service.MotanClassDemoService;
+import org.apache.shenyu.examples.motan.service.MotanTest;
 import 
org.apache.shenyu.springboot.starter.client.motan.ShenyuMotanClientConfiguration;
+import org.springframework.lang.NonNull;
+
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * Motan Class demo service.
@@ -44,4 +50,20 @@ public class MotanClassDemoServiceImpl implements 
MotanClassDemoService {
         }
         return "hello seconds " + seconds + "s";
     }
+
+    @Override
+    public MotanTest save(final MotanTest motanTest) {
+        return motanTest;
+    }
+
+    @Override
+    public MotanTest batchSave(final List<MotanTest> motanTestList) {
+        return new MotanTest(join(motanTestList, MotanTest::getId), "hello 
world shenyu motan param batchSave :" + join(motanTestList, 
MotanTest::getName));
+    }
+
+    private <T> String join(final @NonNull List<T> list, final Function<T, 
String> mapper) {
+        return list.stream()
+                .map(mapper)
+                .collect(Collectors.joining("-"));
+    }
 }
diff --git 
a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCache.java
 
b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCache.java
index eaacca46c5..f80f628fdd 100644
--- 
a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCache.java
+++ 
b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCache.java
@@ -24,16 +24,14 @@ import com.weibo.api.motan.config.ProtocolConfig;
 import com.weibo.api.motan.config.RefererConfig;
 import com.weibo.api.motan.config.RegistryConfig;
 import com.weibo.api.motan.proxy.CommonClient;
-import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.reflect.FieldUtils;
 import org.apache.commons.lang3.tuple.Pair;
 import org.apache.shenyu.common.constant.Constants;
-import org.apache.shenyu.common.dto.convert.plugin.MotanRegisterConfig;
 import org.apache.shenyu.common.dto.MetaData;
+import org.apache.shenyu.common.dto.convert.plugin.MotanRegisterConfig;
 import org.apache.shenyu.common.exception.ShenyuException;
 import org.apache.shenyu.common.utils.GsonUtils;
-import org.apache.shenyu.plugin.motan.util.PrxInfoUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.lang.NonNull;
@@ -42,8 +40,6 @@ import java.lang.reflect.Field;
 import java.util.List;
 import java.util.Objects;
 import java.util.Optional;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.ExecutionException;
 
 /**
@@ -51,39 +47,31 @@ import java.util.concurrent.ExecutionException;
  */
 public final class ApplicationConfigCache {
 
-    /**
-     * The constant PARAM_MAP.
-     */
-    public static final ConcurrentMap<String, MotanParamInfo> PARAM_MAP = new 
ConcurrentHashMap<>();
-
     private static final Logger LOG = 
LoggerFactory.getLogger(ApplicationConfigCache.class);
 
     private RegistryConfig registryConfig;
 
     private ProtocolConfig protocolConfig;
 
-    private final LoadingCache<String, RefererConfig<CommonClient>> cache = 
CacheBuilder.newBuilder()
-            .maximumSize(Constants.CACHE_MAX_COUNT)
-            .removalListener(notification -> {
-                RefererConfig<?> config = (RefererConfig<?>) 
notification.getValue();
-                if (Objects.nonNull(config)) {
-                    try {
-                        Field field = 
FieldUtils.getDeclaredField(config.getClass(), "ref", true);
-                        field.set(config, null);
-                        // After the configuration change, motan destroys the 
instance, but does not empty it. If it is not handled,
-                        // it will get NULL when reinitializing and cause a 
NULL pointer problem.
-                    } catch (NullPointerException | IllegalAccessException e) {
-                        LOG.error("modify ref have exception", e);
-                    }
-                }
-            })
-            .build(new CacheLoader<String, RefererConfig<CommonClient>>() {
-                @Override
-                @NonNull
-                public RefererConfig<CommonClient> load(@NonNull final String 
key) {
-                    return new RefererConfig<>();
-                }
-            });
+    private final LoadingCache<String, RefererConfig<CommonClient>> cache = 
CacheBuilder.newBuilder().maximumSize(Constants.CACHE_MAX_COUNT).removalListener(notification
 -> {
+        RefererConfig<?> config = (RefererConfig<?>) notification.getValue();
+        if (Objects.nonNull(config)) {
+            try {
+                Field field = FieldUtils.getDeclaredField(config.getClass(), 
"ref", true);
+                field.set(config, null);
+                // After the configuration change, motan destroys the 
instance, but does not empty it. If it is not handled,
+                // it will get NULL when reinitializing and cause a NULL 
pointer problem.
+            } catch (NullPointerException | IllegalAccessException e) {
+                LOG.error("modify ref have exception", e);
+            }
+        }
+    }).build(new CacheLoader<String, RefererConfig<CommonClient>>() {
+        @Override
+        @NonNull
+        public RefererConfig<CommonClient> load(@NonNull final String key) {
+            return new RefererConfig<>();
+        }
+    });
 
     private ApplicationConfigCache() {
     }
@@ -112,7 +100,7 @@ public final class ApplicationConfigCache {
         }
         if (Objects.isNull(protocolConfig)) {
             protocolConfig = new ProtocolConfig();
-            protocolConfig.setId("motan2-breeze");
+            protocolConfig.setId("motan2");
             protocolConfig.setName("motan2");
         }
     }
@@ -166,30 +154,14 @@ public final class ApplicationConfigCache {
         reference.setInterface(CommonClient.class);
         reference.setServiceInterface(metaData.getServiceName());
         // the group of motan rpc call
-        MotanParamExtInfo motanParamExtInfo =
-                GsonUtils.getInstance().fromJson(metaData.getRpcExt(), 
MotanParamExtInfo.class);
-        motanParamExtInfo.getMethodInfo().forEach(methodInfo -> {
-            if (CollectionUtils.isNotEmpty(methodInfo.getParams())) {
-                try {
-                    Class<?>[] paramTypes = new 
Class[methodInfo.getParams().size()];
-                    String[] paramNames = new 
String[methodInfo.getParams().size()];
-                    for (int i = 0; i < methodInfo.getParams().size(); i++) {
-                        Pair<String, String> pair = 
methodInfo.getParams().get(i);
-                        paramTypes[i] = 
PrxInfoUtil.getParamClass(pair.getKey());
-                        paramNames[i] = pair.getValue();
-                        PARAM_MAP.put(methodInfo.getMethodName(), new 
MotanParamInfo(paramTypes, paramNames));
-                    }
-                } catch (Exception e) {
-                    LOG.error("failed to init motan, {}", e.getMessage());
-                }
-            }
-        });
+        MotanParamExtInfo motanParamExtInfo = 
GsonUtils.getInstance().fromJson(metaData.getRpcExt(), MotanParamExtInfo.class);
         reference.setGroup(motanParamExtInfo.getGroup());
         reference.setVersion("1.0");
         
reference.setRequestTimeout(Optional.ofNullable(motanParamExtInfo.getTimeout()).orElse(1000));
         reference.setRegistry(registryConfig);
         if (StringUtils.isNotEmpty(motanParamExtInfo.getRpcProtocol())) {
             protocolConfig.setName(motanParamExtInfo.getRpcProtocol());
+            protocolConfig.setId(motanParamExtInfo.getRpcProtocol());
         }
         reference.setProtocol(protocolConfig);
         CommonClient obj = reference.getRef();
@@ -340,67 +312,11 @@ public final class ApplicationConfigCache {
 
         /**
          * Sets rpc protocol.
+         *
          * @param rpcProtocol the rpc protocol
          */
         public void setRpcProtocol(final String rpcProtocol) {
             this.rpcProtocol = rpcProtocol;
         }
     }
-
-    /**
-     * The type Motan param ext info.
-     */
-    public static class MotanParamInfo {
-
-        private Class<?>[] paramTypes;
-
-        private String[] paramNames;
-
-        /**
-         * Instantiates a new Motan param info.
-         *
-         * @param paramTypes the param types
-         * @param paramNames the param names
-         */
-        public MotanParamInfo(final Class<?>[] paramTypes, final String[] 
paramNames) {
-            this.paramTypes = paramTypes;
-            this.paramNames = paramNames;
-        }
-
-        /**
-         * Get param types class [ ].
-         *
-         * @return the class [ ]
-         */
-        public Class<?>[] getParamTypes() {
-            return paramTypes;
-        }
-
-        /**
-         * Sets param types.
-         *
-         * @param paramTypes the param types
-         */
-        public void setParamTypes(final Class<?>[] paramTypes) {
-            this.paramTypes = paramTypes;
-        }
-
-        /**
-         * Get param names string [ ].
-         *
-         * @return the string [ ]
-         */
-        public String[] getParamNames() {
-            return paramNames;
-        }
-
-        /**
-         * Sets param names.
-         *
-         * @param paramNames the param names
-         */
-        public void setParamNames(final String[] paramNames) {
-            this.paramNames = paramNames;
-        }
-    }
 }
diff --git 
a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/proxy/MotanProxyService.java
 
b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/proxy/MotanProxyService.java
index ecc6f5c978..2a79330436 100644
--- 
a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/proxy/MotanProxyService.java
+++ 
b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/main/java/org/apache/shenyu/plugin/motan/proxy/MotanProxyService.java
@@ -24,6 +24,8 @@ import com.weibo.api.motan.rpc.ResponseFuture;
 import com.weibo.api.motan.rpc.RpcContext;
 import com.weibo.api.motan.util.MotanClientUtil;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
 import org.apache.shenyu.common.concurrent.ShenyuThreadFactory;
 import org.apache.shenyu.common.concurrent.ShenyuThreadPoolExecutor;
 import org.apache.shenyu.common.constant.Constants;
@@ -32,9 +34,9 @@ import 
org.apache.shenyu.common.dto.convert.plugin.MotanRegisterConfig;
 import org.apache.shenyu.common.enums.PluginEnum;
 import org.apache.shenyu.common.enums.ResultEnum;
 import org.apache.shenyu.common.exception.ShenyuException;
-import org.apache.shenyu.common.utils.GsonUtils;
 import org.apache.shenyu.common.utils.ParamCheckUtils;
 import org.apache.shenyu.common.utils.Singleton;
+import org.apache.shenyu.plugin.api.utils.BodyParamUtils;
 import org.apache.shenyu.plugin.api.utils.SpringBeanUtils;
 import org.apache.shenyu.plugin.motan.cache.ApplicationConfigCache;
 import org.slf4j.Logger;
@@ -48,11 +50,12 @@ import java.util.Objects;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.ExecutorService;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.ThreadFactory;
 import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.SynchronousQueue;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.LinkedBlockingQueue;
+
 
 /**
  * Motan proxy service.
@@ -86,27 +89,17 @@ public class MotanProxyService {
             reference = ApplicationConfigCache.getInstance().initRef(metaData);
         }
         CommonClient commonClient = reference.getRef();
-        ApplicationConfigCache.MotanParamInfo motanParamInfo = 
ApplicationConfigCache.PARAM_MAP.get(metaData.getMethodName());
-        Object[] params;
-        if (Objects.isNull(motanParamInfo)) {
-            params = new Object[0];
+        Pair<String[], Object[]> pair;
+        if (StringUtils.isBlank(metaData.getParameterTypes()) || 
ParamCheckUtils.bodyIsEmpty(body)) {
+            pair = new ImmutablePair<>(new String[]{}, new Object[]{});
         } else {
-            int num = motanParamInfo.getParamTypes().length;
-            params = new Object[num];
-            Map<String, Object> bodyMap = 
GsonUtils.getInstance().convertToMap(body);
-            ParamCheckUtils.checkParamsLength(bodyMap.size(), 
motanParamInfo.getParamNames().length);
-            for (int i = 0; i < num; i++) {
-                //Fix the bug by dylan,Use primitive type。Otherwise, the 
generalization call will fail
-                params[i] = bodyMap.get(motanParamInfo.getParamNames()[i]);
-            }
+            pair = BodyParamUtils.buildParameters(body, 
metaData.getParameterTypes());
         }
         ResponseFuture responseFuture;
         //CHECKSTYLE:OFF IllegalCatch
         try {
-            Request request = 
MotanClientUtil.buildRequest(reference.getServiceInterface(), 
metaData.getMethodName(), metaData.getParameterTypes(), params, null);
+            Request request = 
MotanClientUtil.buildRequest(reference.getServiceInterface(), 
metaData.getMethodName(), metaData.getParameterTypes(), pair.getRight(), null);
             responseFuture = (ResponseFuture)commonClient.asyncCall(request, 
Object.class);
-            //responseFuture = (ResponseFuture) 
commonClient.asyncCall(metaData.getMethodName(), params, Object.class);
-
         } catch (Throwable e) {
             LOG.error("Exception caught in MotanProxyService#genericInvoker.", 
e);
             return null;
diff --git 
a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/test/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCacheTest.java
 
b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/test/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCacheTest.java
index 2808bd2c47..a24ded76d1 100644
--- 
a/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/test/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCacheTest.java
+++ 
b/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-motan/src/test/java/org/apache/shenyu/plugin/motan/cache/ApplicationConfigCacheTest.java
@@ -35,15 +35,6 @@ import java.util.List;
  */
 public final class ApplicationConfigCacheTest {
 
-    @Test
-    public void testMotanParamInfo() {
-        ApplicationConfigCache.MotanParamInfo motanParamInfo = new 
ApplicationConfigCache.MotanParamInfo(null, null);
-        motanParamInfo.setParamNames(new String[]{"test"});
-        motanParamInfo.setParamTypes(new 
Class<?>[]{ApplicationConfigCache.class});
-        Assertions.assertEquals(motanParamInfo.getParamNames()[0], "test");
-        Assertions.assertEquals(motanParamInfo.getParamTypes()[0], 
ApplicationConfigCache.class);
-    }
-
     @Test
     public void testMotanParamExtInfo() {
         ApplicationConfigCache.MotanParamExtInfo motanParamExtInfo = new 
ApplicationConfigCache.MotanParamExtInfo();
@@ -90,7 +81,7 @@ public final class ApplicationConfigCacheTest {
         Field field2 = 
applicationConfigCache.getClass().getDeclaredField("protocolConfig");
         field2.setAccessible(true);
         ProtocolConfig protocolConfig = (ProtocolConfig) 
field2.get(applicationConfigCache);
-        Assertions.assertEquals(protocolConfig.getId(), "motan2-breeze");
+        Assertions.assertEquals(protocolConfig.getId(), "motan2");
     }
 
     @Test

Reply via email to