apache / apache/dubbo-website

Dubbo SPI 加载问题

Open
#762 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
491
Forks
809
Avg merge
1d 6h
Merged PRs (30d)
6

Description

关于dubbo加载spi的文档说明,都强调按需使用,其实这里有个概念容易混淆,那就是spi对应的Class 实例以及spi实例本身。
也就是dubbo只是在用到的时候再实例化spi,而对于spi对应的Class实例,是一开始都加载进来的,文档中这点并没有说清楚。
举个例子,xxx.DemoService接口有两个实现类:
```
a=xxx.ADemoServiceImpl
b=xxx.BDemoServiceImpl
```

那么dubbo是都会把 ADemoServiceImpl.class 和 BDemoServiceImpl.class 都加载到内存,只是在需要的时候再根据 .class 进行实例化,获得相应的spi实例。

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate the Dubbo SPI documentation in the Hugo site and read the section describing on-demand use. Clarify the distinction between loading implementation classes and instantiating SPI objects, using the issue's DemoService example; the documentation is done when this lifecycle distinction is explicit.

Written by the indexing model from the issue text.

Assessment

Tech stack
hugo
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.