diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java index 703f399cedb06..a2f262e71b241 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/ClusterContextManagerBuilder.java @@ -35,7 +35,6 @@ import org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory; import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository; import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepositoryConfiguration; -import org.apache.shardingsphere.mode.subsciber.RuleItemChangedSubscriber; import java.sql.SQLException; @@ -81,7 +80,6 @@ private void registerOnline(final RegistryCenter registryCenter, final ContextMa loadClusterStatus(registryCenter, contextManager); contextManager.getInstanceContext().getInstance().setLabels(param.getLabels()); contextManager.getInstanceContext().getAllClusterInstances().addAll(registryCenter.getComputeNodeStatusService().loadAllComputeNodeInstances()); - contextManager.getInstanceContext().getEventBusContext().register(new RuleItemChangedSubscriber(contextManager)); new ClusterEventSubscriberRegistry(contextManager, registryCenter).register(); } diff --git a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ClusterEventSubscriberRegistry.java b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ClusterEventSubscriberRegistry.java index c81a8181e96fd..67c9d3e90eaf4 100644 --- a/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ClusterEventSubscriberRegistry.java +++ b/mode/type/cluster/core/src/main/java/org/apache/shardingsphere/mode/manager/cluster/coordinator/subscriber/ClusterEventSubscriberRegistry.java @@ -21,6 +21,7 @@ import org.apache.shardingsphere.mode.manager.cluster.coordinator.RegistryCenter; import org.apache.shardingsphere.mode.manager.cluster.coordinator.registry.process.subscriber.ProcessListChangedSubscriber; import org.apache.shardingsphere.mode.subsciber.EventSubscriberRegistry; +import org.apache.shardingsphere.mode.subsciber.RuleItemChangedSubscriber; /** * Cluster event subscriber registry. @@ -28,7 +29,9 @@ public final class ClusterEventSubscriberRegistry extends EventSubscriberRegistry { public ClusterEventSubscriberRegistry(final ContextManager contextManager, final RegistryCenter registryCenter) { - super(contextManager, new ConfigurationChangedSubscriber(contextManager), + super(contextManager, + new RuleItemChangedSubscriber(contextManager), + new ConfigurationChangedSubscriber(contextManager), new ConfigurationChangedSubscriber(contextManager), new ResourceMetaDataChangedSubscriber(contextManager), new DatabaseChangedSubscriber(contextManager),