Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

dubbo 多模块能力支持 #140

Closed
lvjing2 opened this issue Oct 9, 2023 · 7 comments
Closed

dubbo 多模块能力支持 #140

lvjing2 opened this issue Oct 9, 2023 · 7 comments
Assignees
Labels

Comments

@lvjing2
Copy link
Collaborator

lvjing2 commented Oct 9, 2023

当前多模块能力在 sofaboot 已经较完备的支持,在 springboo 还在建设中,dubbo还未开始。但是有较多用户是使用 dubbo 框架,需要类似 springboot 或 sofaboot,验证 dubbo 建设多模块能力当前存在的gap,并制定后续建设的计划。

@lylingzhen
Copy link
Contributor

根据真实用户需求,我们需要先支持 dubbo 3.0.5 及以上版本。

@lvjing2 lvjing2 added this to the 0.6 版本 10月 milestone Oct 16, 2023
@lvjing2 lvjing2 mentioned this issue Oct 17, 2023
19 tasks
@lvjing2
Copy link
Collaborator Author

lvjing2 commented Oct 17, 2023

发现两处不支持:

  1. dubbo 使用 dubbo.applicaiton.name 设置应用名,而当前我们使用 spring.application.name 来获取基座名
    image
  2. 调用的时候参数无法正常传递,原因还未定位
    image

@zjulbj
Copy link
Contributor

zjulbj commented Oct 20, 2023

发现两处不支持:

  1. dubbo 使用 dubbo.applicaiton.name 设置应用名,而当前我们使用 spring.application.name 来获取基座名
    image
  2. 调用的时候参数无法正常传递,原因还未定位
    image

1、dubbo.applicaiton.name我理解可以对标我们的模块名,dubbo本身已经实现了一个多模块的服务调用模型,参考InjvmInvoker,org.apache.dubbo.rpc.model.ModuleModel

2、demo里面@DubboReference(group = "grpc")默认是走injvm调用,dubbo跨模块调用走了hessian序列化拷贝参数,demo的参数模型是pb的,hessian反序列化的时候字段丢了

@zjulbj
Copy link
Contributor

zjulbj commented Oct 30, 2023

Dubbo 3.x 对多classloader反序列化的支持

TRI协议

1、ReflectionAbstractServerCall切换tccl

请求进来会切换为服务的ServiceModel的classloader,org.apache.dubbo.rpc.protocol.tri.call.ReflectionAbstractServerCall

ClassLoadUtil.switchContextLoader(invoker.getUrl().getServiceModel().getClassLoader());

但是TripleClientCall没切换

2、不同序列化扩展的处理

【支持】Hessian序列化

Hessian不依赖tccl,调用的是getDeserializer

public Deserializer getDeserializer(Class cl)

####【不支持】jdk序列化

protected Class<?> resolveClass(ObjectStreamClass desc)
        throws IOException, ClassNotFoundException
    {
        String name = desc.getName();
        try {
            return Class.forName(name, false, latestUserDefinedLoader());
        } catch (ClassNotFoundException ex) {

####【不支持】fastjson2序列化
客户端反序列化有问题,TripleClientCall没有反序列化


@zjulbj
Copy link
Contributor

zjulbj commented Nov 14, 2023

Dubbo 2.7.x 不支持情况

  • com.alibaba.spring.util.AnnotatedBeanDefinitionRegistryUtils使用base的classloader去加载BizApplication
  • ExtensionLoader不支持按biz隔离
  • ApplicationModel 不支持按biz隔离
  • ConfigManager 不支持biz隔离
  • ServiceRepository不支持biz隔离,会导致不同模块消费统一个服务的配置串掉

@yuanyuancin
Copy link
Collaborator

Dubbo 2.7.x 不支持情况

  • com.alibaba.spring.util.AnnotatedBeanDefinitionRegistryUtils使用base的classloader去加载BizApplication
  • ExtensionLoader不支持按biz隔离
  • ApplicationModel 不支持按biz隔离
  • ConfigManager 不支持biz隔离
  • ServiceRepository不支持biz隔离,会导致不同模块消费统一个服务的配置串掉

dubbo2.7 适配pr:#433

  1. AnnotatedBeanDefinitionRegistryUtils使用bizclassloader,已改
  2. ExtensionLoader没动,对获取的ConfigManager、ServiceRepository做了适配
  3. ApplicationModel 目前没动
  4. ConfigManager 支持biz隔离,已改
  5. ServiceRepository 根据path做了隔离,不同模块消费同一个服务配置串掉要再看一下,

@lvjing2
Copy link
Collaborator Author

lvjing2 commented Jan 24, 2024

已完成

@lvjing2 lvjing2 closed this as completed Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants