5. 缓存随机属性源

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

myrandom=${cachedrandom.appname.value}