CacheManager config

This commit is contained in:
redkale
2024-06-07 14:58:42 +08:00
parent 1a4e2986ad
commit 5e5577e685
2 changed files with 338 additions and 338 deletions

View File

@@ -46,9 +46,10 @@ serviceid1_name1 serviceid1_name2 serviceid2_name1 serviceid2_name2
【节点全局唯一】 @since 2.8.0
全局Serivce的缓存设置没配置该节点将自动创建一个。
enabled 是否开启缓存功能。默认: true
source: 远程CacheSource的资源名
remote: 远程CacheSource的资源名
broadcastable: 存在远程CacheSource时修改数据是否进行广播到其他集群服务中。默认: true
-->
<cache enabled="true" source="xxx"/>
<cache enabled="true" remote="xxx" broadcastable="true"/>
<!--
【节点全局唯一】

View File

@@ -32,7 +32,6 @@ import org.redkale.util.AnyValue;
import org.redkale.util.RedkaleException;
import org.redkale.util.ThrowSupplier;
import org.redkale.util.TypeToken;
import org.redkale.util.Utility;
/**
* 缓存管理器
@@ -110,7 +109,7 @@ public class CacheManagerService implements CacheManager, Service {
if (this.enabled) {
this.localSource.init(conf);
String remoteSourceName = conf.getValue("remote");
if (remoteSource == null && Utility.isNotBlank(remoteSourceName)) {
if (remoteSource == null && remoteSourceName != null) {
this.broadcastable = conf.getBoolValue("broadcastable", true);
CacheSource source = application.loadCacheSource(remoteSourceName, false);
if (source == null) {