Comments (5)
客户端的生成源码在com.alibaba.dubbo.config.ReferenceConfig
调用ReferenceConfig.get()获取服务端泛化接口,源码有点多就不贴了
from dubbo-go-hessian2.
贴一下使用的java代码吧
public static Object invokeDubbo(UrlPathInfo pathInfo, Object[] parameterObjects) {
ReferenceConfig<GenericService> referenceConfig = null;
try {
referenceConfig = referenceConfigLoadingCache.get(pathInfo);
} catch (ExecutionException e) {
logger.error("get referenceConfig from jvm cache has error", e);
}
if (referenceConfig == null) {
referenceConfig = buildReferenceConfig(pathInfo);
if (referenceConfig != null) {
referenceConfigLoadingCache.refresh(pathInfo);
}
}
GenericService genericService = referenceConfig.get();
String[] paramTypes = pathInfo.getParameterTypes();
Object returnValue = genericService.$invoke(pathInfo.getMethodName(), paramTypes, parameterObjects);
//void 返回为null
return returnValue;
}
from dubbo-go-hessian2.
和 @pantianying 沟通,目前golang hessian2不支持反序列化未定义的pojo数据为map,而java是可以的,需要调研的是java的实现机制是如何? 是不是针对泛化的请求,java server端会用map的方式来序列化返回数据? 如果对java有研究的,请分享一下!
from dubbo-go-hessian2.
@wongoo
是的 go客户端要实现pojo到map,这部分应该是要放在hessain2里
这个观点是错误的
from dubbo-go-hessian2.
大家好,根据阅读源码和@fangyincheng一起测试,pojo到map的步骤确认是在java的provder实现了,目前goclient端利用如下的interface定义,可以调通java provider端的泛化调用。
因为java服务端只把pojo转成了map,客户端目前还需要区别pojo数组还是单个pojo。这个希望能通过一个interface{} 接受所有的返回。
这个实现需要两位评估。
from dubbo-go-hessian2.
Related Issues (20)
- dubbo Java-Client 调用 Go-Server 接口时,获取的对象一直为null HOT 1
- different field with same pointer type under the same structure deserialization exception HOT 2
- 完善对Java枚举类型可变长参数方法的支持
- when a struct has more than one kind of empty slice whose type is pointer ,decode will panic HOT 2
- update the readme
- 怎样友好的兼容 java 中的集合类 HOT 4
- java.lang.Long 是Java特定语言类型对象,对应的Go怎么传参 HOT 5
- go-client调用Java-serve 当java接口参数类型Integer等包装类时go报错找不到服务 HOT 2
- hessian2中response.go的ReflectResponse方法注释的TODO有计划了吗? HOT 3
- 时间encode越界 HOT 7
- Support java wrapper types HOT 3
- Map嵌套Map遇到illegal class index @idx 1 HOT 2
- 两个Map结构不同但值为nil时,decode will panic
- decode Integer -> *int32 报错 HOT 1
- 单测里面使用 log.Fatal 会使得单测直接通过 HOT 3
- type transfer error HOT 3
- Dubbo-go作为Provider时, RPC返回的结构体中的指针字段无法被Java正确映射为Java包装类型 HOT 2
- hessian 解参panic HOT 8
- nil encoding not correct
- Feature: 新增对jdk17、jdk21的新类型的支持
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dubbo-go-hessian2.