zrlw commented on issue #9237:
URL: https://github.com/apache/dubbo/issues/9237#issuecomment-977785446


   @stone-98 
   是不是在dubbo-hessian-lite的pom文件加入bson依赖:
   ```
   <dependency>
       <groupId>org.mongodb</groupId>
       <artifactId>bson</artifactId>
       <version>4.4.0</version>
   </dependency>
   ```
   然后实现
   1. ObjectIdHandler
   构造方法入参为ObjectId对象,调用ObjectId.toByteArray()方法获取byte数组并保存;
   2. ObjectIdSerializer:
   new ObjectId(ObjectIdHandler的byte数组变量)创建ObjectId对象;
   3. SerializerFactory#getSerializer增加ObjectId分支,配置ObjectIdHandler
   4. 增加用于验证的单元测试
   如果上述理解没有问题,我可以代你加个PR。
   
   我有个疑问,有没有更加通用一点的办法么?每个默认序列化方法搞不定的数据类型难道都要在pom里面去加一个依赖才可以么?


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to