Comments (3)
首先说为啥会扫描2次, 他是由不同的俩个 ServiceAnnotationPostProcessor
类实例扫描的
第一个ServiceAnnotationPostProcessor
实例创建的时机是 通过 enabledubbo 注解注入的 从 DubboComponentScanRegistrar
类中,
第二个实例是 springboot autoconfig 的spring.factories 文件扫描注入的 当配置了 属性 dubbo.scan.base-packages
以后会注入一个 ServiceAnnotationPostProcessor
新的实例对象 (查看 DubboAutoConfiguration )
为啥第二次会扫描不到 因为 用了容器中的 servicePackagesHolder
来校验了 扫描路径是否被扫描过 以及类是否已经被扫描过,如果被扫描过是不会再次被扫描的 所以你的第二次进入是一个空的返回,
你第一次的扫描路径是 org.dromara.system
(EnableDubbo 的scanBasePackages 属性) 第二个为 org.dromara.**.dubbo
(properties中 dubbo.scan.base-packages) 第二个路径的所有类都在第一个路径中扫描过时 第二个路径就不会扫描返回到任何类
from dubbo.
Please translate the content to English:)
from dubbo.
首先说为啥会扫描2次, 他是由不同的俩个
ServiceAnnotationPostProcessor
类实例扫描的 第一个ServiceAnnotationPostProcessor
实例创建的时机是 通过 enabledubbo 注解注入的 从DubboComponentScanRegistrar
类中, 第二个实例是 springboot autoconfig 的spring.factories 文件扫描注入的 当配置了 属性dubbo.scan.base-packages
以后会注入一个ServiceAnnotationPostProcessor
新的实例对象 (查看 DubboAutoConfiguration )为啥第二次会扫描不到 因为 用了容器中的
servicePackagesHolder
来校验了 扫描路径是否被扫描过 以及类是否已经被扫描过,如果被扫描过是不会再次被扫描的 所以你的第二次进入是一个空的返回, 你第一次的扫描路径是org.dromara.system
(EnableDubbo 的scanBasePackages 属性) 第二个为org.dromara.**.dubbo
(properties中 dubbo.scan.base-packages) 第二个路径的所有类都在第一个路径中扫描过时 第二个路径就不会扫描返回到任何类
那是否配了 dubbo.scan.base-packages
就不需要 EnableDubbo
注解了, 或者EnableDubbo
标注后 就不需要 dubbo.scan.base-packages
配置了
from dubbo.
Related Issues (20)
- [Feature] Rest Support For Triple Protocol Overview
- [Feature] Triple Unary Call Support On Servlet
- [Bug] Reference. setCheck (false) and consumer:Check: False is set to false, but when the project starts, it still prompts for connection failure HOT 1
- [Feature] Dubbo Triple OpenAPI Support Requirements
- [Feature] Allow modules to extend Dubbo application configuration HOT 2
- Nacos注册中心开启tls.enable与RocketMQ冲突[Bug] HOT 2
- [Feature] Why RedisMetaDataReport not reuse JedisCluster HOT 2
- [Bug] Dubbo 3.2.11 , use dual registries(ZK+Nacos),provider defined timeout expires(consumer no timeout specified) HOT 4
- [Bug] Dubbo 3.2.11 , use dual registries(ZK+Nacos),provider defined timeout expires(consumer no timeout specified) HOT 2
- [Bug] redis、consul、etcd not 'mapping' implementation HOT 4
- [Question] support Lambda parameter in remote method invoke
- [Bug] Some test cases still rely on the REST protocol HOT 3
- [Feature] Design and implement new conditional rules V3.1
- [Bug] When Service Discovery is enabled, the same registryId may create two ServiceDiscoveryRegistry HOT 2
- [Feature] SSL certificate configuration support for HTTP/3
- [Feature] Flow control support for HTTP/3
- [Feature] HTTP version negotiation on the consumer side for HTTP/3
- [Feature] Integration testing and Example for HTTP/2 HOT 1
- [Feature] Integration testing and Example for triple over servlet HOT 1
- [Feature] Does Dubbo support obtaining matedata data for protobuf? No cases found
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.