liubao68 commented on issue #1413: servicecomb有类似dubbo泛化调用的功能吗,如果有的话怎么使用呢
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/1413#issuecomment-581210774
 
 
   
2.0.0支持了这种方式,例子[参考](https://github.com/apache/servicecomb-java-chassis/blob/master/demo/demo-pojo/pojo-client/src/main/java/org/apache/servicecomb/demo/pojo/client/TestWeakPojo.java)
   
   需要注意的是,泛化调用客户端指定的参数列表是“Swagger 
Arguments”,需要查看服务端的生成的swagger接口描述,然后通过map传递参数列表。对于RPC(POJO)和Spring 
MVC开发模式,契约会有所差异。上述例子展现了RPC模式:
   
   ```
       Map<String, Object> args = new HashMap<>();
       args.put("x", 2);
       args.put("y", 3);
       Map<String, Object> swaggerArgs = new HashMap<>();
       swaggerArgs.put("differentNameBody", args);
       TestMgr.check(7, InvokerUtils.syncInvoke("pojo", "WeakPojo", 
"differentName", swaggerArgs));
   ```
   
   RPC模式会将所有参数包装为一个body参数,所有实际的参数是differentNameBody

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to