tag1. refreshes the common configuration for a single project, such as some constants, mappings, etc.
tag2. write component configuration for redis/datasource.
Since 1 tends to have a lot of k, v .then I don't confirm where the bean refresh, I have to choose refreshAll but this will refresh redis/datasource etc. But I don't want to refresh redis/datasource
I hope to consider adding the excloude("beanName") method to support it.
as follows: refreshScope.refreshAll().exclude({'redis','datasource'});
Comment From: jtanza
hiyah, I haven't contributed to the repo before, but this one looks like a relatively easy change(?). Mind if I give it a shot?
Comment From: spencergibb
I'd like to see if there is more interest from the community
Comment From: kkrgwbj
@jtanza If you like, of course you can. It is an open source software like spring cloud config, but it will automatically detect the configuration changes and refresh the bean.
Comment From: kkrgwbj
@spencergibb thanks.
Comment From: artemptushkin
I was going to apply this feature and notice that this feature will break backward compatibility.
-
refreshScope.refreshAll().exclude({'redis','datasource'});: doesnt fit because#void refreshAllmust return a builder in this case - breaking compatibility -
refreshScope.refreshAll(exclusions): it is possible but will lose consistency withRefreshScopeRefreshedEventon everyrefreshcall.RefreshScopeRefreshedEventaccepts a name or a default name__refreshAll__. We'll have to collect all the names to return it toRefreshScopeobject and it requires to add new method tointerface ScopeCache- breaks compatibility. And this case will proceed a lot of events for every bean name, I think is not appropriate
I'd open a PR if the interface changes are worth it.