I think it's a good question and idea for changing the configuration parameter value during runtime. now we can update via SentinelConfig#setConfig, and some may not take effects after startup.
Which configuration do you need to modified in your project? @zohar-soul
Supporting dynamic configuration parameters is an useful ability which will improve the flexibility of Sentinel, some parameter may be carefully modified since they are imporant and effects a lot, and it need to discuss deeply. @sczyh30@jasonjoo2010@linlinisme
7条答案
按热度按时间pjngdqdw1#
You may update the general conf via
SentinelConfig
, but pay attention that some of the attributes are used during the initialization of Sentinel.mccptt672#
@sczyh30
我有看到这个SentinelConfig,但是从别的issue下看到的回答来看,是要在sentinel初始化之前设置才有效.
所以我的意思是sentinel初始化之后还能修改这个么?
或者有什么hook或者拦截器会在初始化之前回调么?
wnvonmuf3#
I think it's a good question and idea for changing the configuration parameter value during runtime.
now we can update via
SentinelConfig#setConfig
, and some may not take effects after startup.Which configuration do you need to modified in your project? @zohar-soul
Supporting dynamic configuration parameters is an useful ability which will improve the flexibility of Sentinel, some parameter may be carefully modified since they are imporant and effects a lot, and it need to discuss deeply. @sczyh30@jasonjoo2010@linlinisme
xjreopfe4#
@cdfive
目前对我来说主要是 project.name, 因为在使用 Apollo 的时候我希望他简单的与 Apollo 中的 appid保持一致, 那么对于这种情况下, 我不得不把相同的 name 分别设置给 sentinel, Apollo, 而为了避免这种重复性的操作, 我目前是在启动时获取到appid后再设置给sentinel, 那么为了保证能设置成功, 我就需要保证在sentinel初始化之前设置, 而这并不是一个非常易于控制的事情...
所以我的意思是,sentinel如果能提供手动控制初始化的过程的话, 将对梳理各个组件的初始化顺序有很大的帮助...
现在sentinel有可能会在手动调用 InitExecutor::doInit 前就已经自行初始化了...
sbdsn5lh5#
@zohar-soul 老哥最后有解决方案么?我遇到了跟你一样的问题
x9ybnkn66#
@lastsmail
没有, 我假设他并不会在我手动调用前初始化..
0ve6wy6x7#
@zohar-soul 我在想,可不可以通过设置系统属性的方式来使这个东西生效……