Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[config] sdk 支持禁用本地缓存 #563

Closed
wangdongyun opened this issue Jan 31, 2023 · 1 comment
Closed

[config] sdk 支持禁用本地缓存 #563

wangdongyun opened this issue Jan 31, 2023 · 1 comment
Assignees
Labels
2.0.0 enhancement New feature or request

Comments

@wangdongyun
Copy link
Contributor

wangdongyun commented Jan 31, 2023

sdk 在获取配置的时候支持禁用本地缓存

  • 目前sdk 在拉取远程nacos配置失败之后,会读取本地文件
  • 但是有些场景,希望使用nacos 最新配置,如果拉取不到,返回空值
    • 比如业务上的开关场景,如果读取到旧的值,可能会产生故障

Java nacos sdk 是如何工作的?

java sdk 支持这种功能

 //禁用本地缓存,缓存仍然会更新
 com.alibaba.nacos.client.config.utils.SnapShotSwitch.setIsSnapShot(false);
@wangdongyun
Copy link
Contributor Author

wangdongyun commented Jan 31, 2023

这个功能是否OK的,我可以提pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0.0 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants