5. 缓存随机属性源
Spring Cloud Context 提供了一个PropertySource
它根据键缓存随机值。在缓存之外
功能与 Spring Boot 的RandomValuePropertySource
.
如果您希望随机值即使在 Spring 应用程序之后也保持一致
context 重新启动。属性值采用cachedrandom.[yourkey].[type]
哪里yourkey
是缓存中的键。这type
value 可以
是 Spring Boot 支持的RandomValuePropertySource
.
myrandom=${cachedrandom.appname.value}