[ISSUE #3949] add shutdown in ClusterMetadataService

This commit is contained in:
kaiyi.lk
2022-07-13 11:29:36 +08:00
committed by zhouxiang
parent 95b8105ffa
commit bb5e55df16
2 changed files with 8 additions and 1 deletions
@@ -55,7 +55,7 @@ public class ClusterServiceManager extends AbstractStartAndShutdown implements S
private final TopicRouteService topicRouteService;
private final MessageService messageService;
private final ProxyRelayService proxyRelayService;
private final MetadataService metadataService;
private final ClusterMetadataService metadataService;
private final ScheduledExecutorService scheduledExecutorService;
private final MQClientAPIFactory messagingClientAPIFactory;
@@ -107,6 +107,7 @@ public class ClusterServiceManager extends AbstractStartAndShutdown implements S
this.appendStartAndShutdown(this.operationClientAPIFactory);
this.appendStartAndShutdown(this.topicRouteService);
this.appendStartAndShutdown(this.clusterTransactionService);
this.appendStartAndShutdown(this.metadataService);
}
@Override
@@ -74,6 +74,12 @@ public class ClusterMetadataService extends AbstractStartAndShutdown implements
.maximumSize(config.getSubscriptionGroupConfigCacheMaxNum())
.refreshAfterWrite(config.getSubscriptionGroupConfigCacheExpiredInSeconds(), TimeUnit.SECONDS)
.build(new ClusterSubscriptionGroupConfigCacheLoader());
this.init();
}
protected void init() {
this.appendShutdown(this.cacheRefreshExecutor::shutdown);
}
@Override