diff --git a/src/KurrentDB.Core/ClusterVNode.cs b/src/KurrentDB.Core/ClusterVNode.cs index 2fb7d4984ac..5341ff9b8c9 100644 --- a/src/KurrentDB.Core/ClusterVNode.cs +++ b/src/KurrentDB.Core/ClusterVNode.cs @@ -1063,7 +1063,8 @@ GossipAdvertiseInfo GetGossipAdvertiseInfo() { new Dictionary { ["projections"] = options.Projection.RunProjections != ProjectionType.None || options.DevMode.Dev, ["userManagement"] = options.Auth.AuthenticationType == Opts.AuthenticationTypeDefault && !options.Application.Insecure, - ["atomPub"] = options.Interface.EnableAtomPubOverHttp || options.DevMode.Dev + ["atomPub"] = options.Interface.EnableAtomPubOverHttp || options.DevMode.Dev, + ["connectors"] = options.IsPluginEnabled("Connectors") }, _authenticationProvider ); diff --git a/src/KurrentDB.Core/Configuration/ClusterVNodeOptionsExtensions.cs b/src/KurrentDB.Core/Configuration/ClusterVNodeOptionsExtensions.cs index a0e1cea8592..454e4a4d5a9 100644 --- a/src/KurrentDB.Core/Configuration/ClusterVNodeOptionsExtensions.cs +++ b/src/KurrentDB.Core/Configuration/ClusterVNodeOptionsExtensions.cs @@ -4,6 +4,7 @@ // ReSharper disable CheckNamespace using System; +using System.Linq; using System.Net; using System.Security.Cryptography.X509Certificates; using EventStore.Plugins; @@ -27,6 +28,12 @@ public static ClusterVNodeOptions WithPlugableComponents(this ClusterVNodeOption public static ClusterVNodeOptions WithPlugableComponent(this ClusterVNodeOptions options, IPlugableComponent plugableComponent) => options with { PlugableComponents = [.. options.PlugableComponents, plugableComponent] }; + /// + /// Returns whether a pluggable component with the given name is present and enabled. + /// + public static bool IsPluginEnabled(this ClusterVNodeOptions options, string name) => + options.PlugableComponents.Any(x => string.Equals(x.Name, name, StringComparison.OrdinalIgnoreCase) && x.Enabled); + public static ClusterVNodeOptions InCluster(this ClusterVNodeOptions options, int clusterSize) => options with { Cluster = options.Cluster with { ClusterSize = clusterSize <= 1 diff --git a/src/KurrentDB/Components/Plugins/PluginsService.cs b/src/KurrentDB/Components/Plugins/PluginsService.cs index 051dd4640bc..69567cd4009 100644 --- a/src/KurrentDB/Components/Plugins/PluginsService.cs +++ b/src/KurrentDB/Components/Plugins/PluginsService.cs @@ -11,5 +11,5 @@ namespace KurrentDB.Components.Plugins; public class PluginsService(ClusterVNodeOptions options) { public readonly IReadOnlyList PluggableComponents = options.PlugableComponents.OrderBy(x => x.Name).ToList(); - public bool IsPluginEnabled(string name) => PluggableComponents.Any(x => x.Name == name && x.Enabled); + public bool IsPluginEnabled(string name) => options.IsPluginEnabled(name); }