CachedManager

This commit is contained in:
redkale
2024-09-10 14:53:38 +08:00
parent 9c4aeda85c
commit 352dc9038f
2 changed files with 5 additions and 7 deletions

View File

@@ -26,12 +26,12 @@ public interface CachedManager extends Resourcable {
/**
* 默认的schema
*/
public static final String DEFAULT_SCHEMA = "cached-schema";
public static final String CACHED_SCHEMA = "cached-schema";
/**
* 默认的远程缓存订阅消息的管道名称
*/
public static final String CACHED_CHANNEL_TOPIC = "cached-channel-topic";
public static final String CACHED_TOPIC = "cached-topic";
/**
* 资源名称
@@ -77,9 +77,9 @@ public interface CachedManager extends Resourcable {
default String getChannelTopic() {
String n = resourceName();
if (n.isEmpty()) {
return CACHED_CHANNEL_TOPIC;
return CACHED_TOPIC;
} else {
return CACHED_CHANNEL_TOPIC + ':' + n;
return CACHED_TOPIC + ':' + n;
}
}

View File

@@ -47,8 +47,6 @@ import org.redkale.util.Utility;
@ResourceType(CachedManager.class)
public class CachedManagerService implements CachedManager, CachedActionFunc, Service {
public static final String CACHED_CHANNEL_TOPIC_PREFIX = "cached-update-channel";
protected final Logger logger = Logger.getLogger(getClass().getSimpleName());
protected Level logLevel = Level.FINER;
@@ -120,7 +118,7 @@ public class CachedManagerService implements CachedManager, CachedActionFunc, Se
}
this.name = conf.getValue("name", "");
this.enabled = conf.getBoolValue("enabled", true);
this.schema = checkSchema(conf.getValue("schema", DEFAULT_SCHEMA));
this.schema = checkSchema(conf.getValue("schema", CACHED_SCHEMA));
if (this.enabled) {
this.localSource.init(conf);
String remoteSourceName = conf.getValue("remote", "");