问题描述
我正在尝试在Redis密钥中添加一些前缀。这是在application.properties文件中添加的属性
redis.prefix=local
这是我的配置bean
@Setter
@Getter
@Component("propertyConfig")
public class PropertyConfig {
@Value("${redis.prefix}")
private String redisPrefix;
}
我尝试了所有这些方法,但是没有运气。
@RedisHash(value = "#{@propertyConfig.getRedisPrefix()}_attribute",timetoLive = 300)
@RedisHash(value = "#{propertyConfig.redisPrefix}_attribute",timetoLive = 300)
@RedisHash(value = "${redis.prefix}_attribute",timetoLive = 300)
我的spring boot starter父版本是2.1.15.RELEASE
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)