Do not initialize remote clients if cluster not enabled
@@ -110,6 +110,10 @@ func NewClientBean(factory Factory, dispatcherProvider DispatcherProvider, clust
remoteAdminClients := map[string]admin.Client{}
remoteFrontendClients := map[string]frontend.Client{}
for clusterName, info := range clusterMetadata.GetAllClusterInfo() {
+ if !info.Enabled {
+ continue
+ }
+
dispatcher, err := dispatcherProvider.Get(info.RPCName, info.RPCAddress)
if err != nil {
return nil, err
