提交 73385fac 编写于 作者: zhouweidong's avatar zhouweidong

缓存配置

上级 70eaecf3
......@@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
@EnableCaching
@Configuration
@EnableConfigurationProperties(CacheProperties.class)
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('oneLevel')")
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('L1')")
public class CaffeineCacheConfig {
@Autowired
......
......@@ -39,7 +39,7 @@ import org.springframework.util.StringUtils;
@EnableCaching
@Configuration
@EnableConfigurationProperties(CacheProperties.class)
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('twoLevel')")
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('L2')")
public class RedisCacheConfig {
@Autowired
......
......@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
*/
@Data
@Component
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('oneLevel')")
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('L1')")
public class CaffeineCacheManager implements CacheManager {
private static final int DEFAULT_EXPIRE_AFTER_WRITE = 1;
......
......@@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit;
*/
@Data
@Component
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('twoLevel')")
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('L2')")
public class LayeringCacheManager implements CacheManager {
private static final int DEFAULT_EXPIRE_AFTER_WRITE = 1;
......
......@@ -25,7 +25,7 @@ import java.util.Map;
*/
@Component
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('twoLevel')")
@ConditionalOnExpression("'${r'${ibiz.cacheLevel:None}'}'.equals('L2')")
public class RedisMessageListener extends MessageListenerAdapter {
private static final Logger logger = LoggerFactory.getLogger(RedisPublisher.class);
@Autowired
......
......@@ -203,12 +203,12 @@ ribbon:
<#assign enableDataAcc="false">
#系统是否开启权限验证、是否开启缓存
#缓存级别:无缓存(无配置项)、一级缓存(oneLevel)、二级缓存(twoLevel)
#缓存级别:无缓存(无配置项)、一级缓存(L1)、二级缓存(L2)
ibiz:
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
<#assign enableDataAcc="true">
</#if>
enablePermissionValid: ${enableDataAcc}
cacheLevel: oneLevel #一级缓存,本地caffeine缓存
#cacheLevel: twoLevel #二级缓存,本地caffeine缓存+Redis缓存
cacheLevel: L1 #一级缓存,本地caffeine缓存
#cacheLevel: L2 #二级缓存,本地caffeine缓存+Redis缓存
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册