Comments (4)
非常感谢,你的分析是对的。 ServiceAnnotationBeanPostProcessor
对 sofaRuntimeProperties
的依赖在另一个即将提的PR中已经剥离了,剥离的原因是因为开发另一个特性,碰巧也把你指出的这个问题规避了。 不过仍然非常希望你针对这个问题给我们提Fix PR。 @ScienJus
from sofa-boot.
Hi @QilongZhang ,按照目前的现状,我认为最轻量级的方式就是解除 ServiceAnnotationBeanPostProcessor
对 SofaRuntimeProperties
的强绑定,而是改为在执行时通过 ApplicationContext(BeanFactory)#getBean
的弱绑定。
不知道你是否认同这种修复方案,以及是否有更好的方案?没有的话我会提交一个 PR 以及补充一些简单的测试。
注:其实这个 case 还是影响面很小的,不过在 BeanPostProcessor 使用其他 Bean 导致的加载顺序问题一不小心就会发生,而且用户 debug 还会很麻烦,所以以这个 case 举例介绍下。
from sofa-boot.
@ScienJus 首先感谢。正常情况下,你说的解决方案是可行的。因为另一个在开发的特性,会有一个限制,ReferenceComponent
和 ReferenceRegisterHelper
这两个类,不能直接或间接使用到任何spring相关的类。 目前代码中这两个类都是直接使用 SofaRuntimeProperties
这个类,因为这个类会依赖spring相关类,因此需要剥离。你的方案只需要保证不违背这点限制就好了。
from sofa-boot.
@QilongZhang 目前只是在 ServiceAnnotationBeanPostProcessor
中修改了获取 SofaRuntimeProperties
和 SofaRuntimeContext
,基本没动其他类,所以应该不会影响对其他类的重构?上面提到的两个类的剥离应该 rebase 后不会有冲突,希望如此…
from sofa-boot.
Related Issues (20)
- 使用sofaboot-dependencies 3.19.1 springboot版本是2.7.10 spingcloud版本是2021.0.8 curator版本冲突 HOT 3
- skywalking兼容问题 HOT 4
- 3.x.x 使用rpc报错 HOT 1
- sofa jvm 服务与rpc 服务共存 HOT 1
- dynamic service invoke optimaze HOT 3
- web-biz插件更新问题 HOT 1
- 性能优化 HOT 2
- 线程池监听统计调度线程使用非守护线程是否会存在应用停止时无法正常关闭? HOT 1
- Setting custom thread pools through SofaService annotation does not take effect when interfaceType is not set HOT 1
- Support sofa-rpc provider register blacklist/whitelist HOT 1
- 909090909090
- SOFABoot4.0 升级问题 HOT 1
- 设置延迟暴露,在BOLT协议下,出现RPC cannot find service 异常 HOT 5
- SofaBoot:4.2.0 服务不能正常注册到 Nacos 中 HOT 2
- SofaBoot:4.2.0 不能使用 zookeeper 注册中吗? HOT 2
- sofa性能是否会再次优化 HOT 1
- 【Proposal】支持以k8s为注册中心的配置实现 HOT 1
- sofa.boot.ark.jvmServiceCache HOT 1
- sofa boot invoke question HOT 4
- 初步使用异常 HOT 9
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 sofa-boot.