kitex-contrib / codec-dubbo

支持 kitex <-> dubbo 互通的 dubbo 协议编解码器。
Apache License 2.0
16 stars 14 forks source link

Proposal: compatible with arbitrary java classes #57

Closed felix021 closed 9 months ago

felix021 commented 10 months ago

For example, user may use java.lang.Object or java.util.Date in method request/response, but it's not a valid Thrift type.

To be compatible with arbitrary java classes, a new feature should be implemented to allow specifying an external type (user-defined, not Thrift native types).

If this type has implemented hessian.Serializer (by dubbo-go-hessian2), it can be registered with hessian.SetSerializer(javaClassName, serializer)

Before that, there's a workaround, please refer to: https://bytedance.sg.feishu.cn/docx/Q8XOdfxsCorkPYxcWiSlu9ITgEc

felix021 commented 9 months ago

Implemented in https://github.com/cloudwego/kitex/pull/1167 and https://github.com/cloudwego/kitex/pull/1168