You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "soiz-tor (via GitHub)" <gi...@apache.org> on 2023/03/07 04:59:50 UTC

[GitHub] [dubbo] soiz-tor opened a new issue, #11755: 关于GenericService泛化调用测试dubbo接口的疑问

soiz-tor opened a new issue, #11755:
URL: https://github.com/apache/dubbo/issues/11755

   测试环境:
   jdk:19
   dubbo:3.2.0-beta.5
   
   我现在在对dubbo接口进行测试,这是我的测试代码:
   ```
   public class DubboTest {
       public static void main(String[] args) {
           // 应用配置
           ApplicationConfig application = new ApplicationConfig();
           application.setName("dubbo-test");
   
           // 注册中心配置
           RegistryConfig registry = new RegistryConfig();
           registry.setAddress("nacos://192.168.220.128:8848");
   
           // 引用远程服务
           ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
           reference.setApplication(application);
           reference.setRegistry(registry);
           reference.setInterface("com.psyjournel.api.user.UserService");
           reference.setGeneric("true");
   
   
           // 获取远程服务代理
           GenericService genericService = reference.get();
   
           // 调用远程方法
           Object result = genericService.$invoke("loginService", new String[] {"java.lang.String"}, new Object[] {"world"});
           Map<String, Object> resultMap = (HashMap<String, Object>) result;
           JSONObject json = new JSONObject(resultMap);
           System.out.println(json);
       }
   }
   ```
   setApplication处报过时的方法警告,但是在官网上给出的文档里没有写出新方法的用法,请问下应该怎么做?
   --------------------------------------------
   ```
   //无关日志
   {"message":"login success","class":"com.psyjournel.util.ServerResponseEntity","code":0}
   //无关日志
   ```
   虽然测试结果拿到了我想要的,但是打印了许多无关的日志,请问这些无关日志如何关闭?而只返回我需要的结果


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] soiz-tor commented on issue #11755: 关于GenericService泛化调用测试dubbo接口的疑问

Posted by "soiz-tor (via GitHub)" <gi...@apache.org>.
soiz-tor commented on issue #11755:
URL: https://github.com/apache/dubbo/issues/11755#issuecomment-1462406086

   > 这是采用protobuf进行序列化吗,protobuf原生不支持泛化调用,dubbo侧不应该帮用户兜这个底,可以考虑用hession或其他序列化方式实现
   
   emmm  好像我的提问和序列化没有什么关系  是我在按照官网给的例子,然后idea编辑器提示reference.setApplication(application);这个setApplication报过时的方法  但是官网并没有给出新的方法调用


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] aamingaa commented on issue #11755: 关于GenericService泛化调用测试dubbo接口的疑问

Posted by "aamingaa (via GitHub)" <gi...@apache.org>.
aamingaa commented on issue #11755:
URL: https://github.com/apache/dubbo/issues/11755#issuecomment-1462319610

   这是采用protobuf进行序列化吗,protobuf原生不支持泛化调用,dubbo侧不应该帮用户兜这个底,可以考虑用hession或其他序列化方式实现


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] soiz-tor closed issue #11755: 关于GenericService泛化调用测试dubbo接口的疑问

Posted by "soiz-tor (via GitHub)" <gi...@apache.org>.
soiz-tor closed issue #11755: 关于GenericService泛化调用测试dubbo接口的疑问
URL: https://github.com/apache/dubbo/issues/11755


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] soiz-tor commented on issue #11755: 关于GenericService泛化调用测试dubbo接口的疑问

Posted by "soiz-tor (via GitHub)" <gi...@apache.org>.
soiz-tor commented on issue #11755:
URL: https://github.com/apache/dubbo/issues/11755#issuecomment-1463517600

   > 虽然是告警但是应该不影响使用,应该是为了兼容dubbo2。你可以参考一下 源码里的[demo](https://github.com/apache/dubbo/blob/3.2/dubbo-demo/dubbo-demo-triple/src/main/java/org/apache/dubbo/demo/consumer/ApiConsumer.java)。这样初始化使用 就不会提示了
   
   非常感谢


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] liufeiyu1002 commented on issue #11755: 关于GenericService泛化调用测试dubbo接口的疑问

Posted by "liufeiyu1002 (via GitHub)" <gi...@apache.org>.
liufeiyu1002 commented on issue #11755:
URL: https://github.com/apache/dubbo/issues/11755#issuecomment-1463515973

   虽然是告警但是应该不影响使用,应该是为了兼容dubbo2。你可以参考一下 源码里的[demo](https://github.com/apache/dubbo/blob/3.2/dubbo-demo/dubbo-demo-triple/src/main/java/org/apache/dubbo/demo/consumer/ApiConsumer.java)。这样初始化使用 就不会提示了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org