CacheManager config
This commit is contained in:
@@ -46,9 +46,10 @@ serviceid1_name1 serviceid1_name2 serviceid2_name1 serviceid2_name2
|
|||||||
【节点全局唯一】 @since 2.8.0
|
【节点全局唯一】 @since 2.8.0
|
||||||
全局Serivce的缓存设置,没配置该节点将自动创建一个。
|
全局Serivce的缓存设置,没配置该节点将自动创建一个。
|
||||||
enabled: 是否开启缓存功能。默认: true
|
enabled: 是否开启缓存功能。默认: true
|
||||||
source: 远程CacheSource的资源名
|
remote: 远程CacheSource的资源名
|
||||||
|
broadcastable: 存在远程CacheSource时修改数据是否进行广播到其他集群服务中。默认: true
|
||||||
-->
|
-->
|
||||||
<cache enabled="true" source="xxx"/>
|
<cache enabled="true" remote="xxx" broadcastable="true"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
【节点全局唯一】
|
【节点全局唯一】
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ import org.redkale.util.AnyValue;
|
|||||||
import org.redkale.util.RedkaleException;
|
import org.redkale.util.RedkaleException;
|
||||||
import org.redkale.util.ThrowSupplier;
|
import org.redkale.util.ThrowSupplier;
|
||||||
import org.redkale.util.TypeToken;
|
import org.redkale.util.TypeToken;
|
||||||
import org.redkale.util.Utility;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存管理器
|
* 缓存管理器
|
||||||
@@ -110,7 +109,7 @@ public class CacheManagerService implements CacheManager, Service {
|
|||||||
if (this.enabled) {
|
if (this.enabled) {
|
||||||
this.localSource.init(conf);
|
this.localSource.init(conf);
|
||||||
String remoteSourceName = conf.getValue("remote");
|
String remoteSourceName = conf.getValue("remote");
|
||||||
if (remoteSource == null && Utility.isNotBlank(remoteSourceName)) {
|
if (remoteSource == null && remoteSourceName != null) {
|
||||||
this.broadcastable = conf.getBoolValue("broadcastable", true);
|
this.broadcastable = conf.getBoolValue("broadcastable", true);
|
||||||
CacheSource source = application.loadCacheSource(remoteSourceName, false);
|
CacheSource source = application.loadCacheSource(remoteSourceName, false);
|
||||||
if (source == null) {
|
if (source == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user