diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index 2d7e064b9a..2ba06f1d46 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -34,7 +34,7 @@
-
+
diff --git a/src/ServiceControl.Transports.ASBS/ASBSTransportCustomization.cs b/src/ServiceControl.Transports.ASBS/ASBSTransportCustomization.cs
index 4082fdcc0c..c5607a7288 100644
--- a/src/ServiceControl.Transports.ASBS/ASBSTransportCustomization.cs
+++ b/src/ServiceControl.Transports.ASBS/ASBSTransportCustomization.cs
@@ -1,7 +1,11 @@
namespace ServiceControl.Transports.ASBS
{
+ using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
+ using System.Threading.Tasks;
+ using Azure.Messaging.ServiceBus;
+ using Azure.Messaging.ServiceBus.Administration;
using BrokerThroughput;
using Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -71,18 +75,7 @@ protected override void AddTransportForPrimaryCore(IServiceCollection services,
{
TopicToPublishTo = connectionSettings.TopicName,
TopicToSubscribeOn = connectionSettings.TopicName,
- EventsToMigrateMap =
- [
- "ServiceControl.Contracts.CustomCheckFailed",
- "ServiceControl.Contracts.CustomCheckSucceeded",
- "ServiceControl.Contracts.HeartbeatRestored",
- "ServiceControl.Contracts.HeartbeatStopped",
- "ServiceControl.Contracts.FailedMessagesArchived",
- "ServiceControl.Contracts.FailedMessagesUnArchived",
- "ServiceControl.Contracts.MessageFailed",
- "ServiceControl.Contracts.MessageFailureResolvedByRetry",
- "ServiceControl.Contracts.MessageFailureResolvedManually"
- ]
+ EventsToMigrateMap = [.. transportSettings.EventTypesPublished.Select(t => t.FullName)]
});
}
else if (SettingsReader.TryRead(serviceBusRootNamespace, "Topology", out var topologyJson))
@@ -104,5 +97,47 @@ protected override void AddTransportForMonitoringCore(IServiceCollection service
services.AddSingleton();
services.AddHostedService(provider => provider.GetRequiredService());
}
+
+ public override async Task ProvisionQueues(TransportSettings transportSettings, IEnumerable additionalQueues)
+ {
+ await base.ProvisionQueues(transportSettings, additionalQueues);
+
+ if (transportSettings.EventTypesPublished.Count == 0)
+ {
+ return;
+ }
+
+ var connectionSettings = ConnectionStringParser.Parse(transportSettings.ConnectionString);
+
+ var managementClient = connectionSettings.AuthenticationMethod.BuildManagementClient();
+
+ var creationTasks = new List(transportSettings.EventTypesPublished.Count);
+ foreach (var publishedTopic in transportSettings.EventTypesPublished)
+ {
+ creationTasks.Add(CreateTopic(publishedTopic.FullName));
+ }
+ await Task.WhenAll(creationTasks);
+
+ async Task CreateTopic(string publishedTopic)
+ {
+ var topicToPublishTo = new CreateTopicOptions(connectionSettings.HierarchyNamespace != null
+ ? $"{connectionSettings.HierarchyNamespace}/{publishedTopic}"
+ : publishedTopic)
+ {
+ EnableBatchedOperations = true,
+ MaxSizeInMegabytes = 5 * 1024, // we are currently not configuring this in the connection string so it uses the same default as the transport
+ EnablePartitioning = connectionSettings.EnablePartitioning,
+ };
+
+ try
+ {
+ await managementClient.CreateTopicAsync(topicToPublishTo).ConfigureAwait(false);
+ }
+ catch (ServiceBusException sbe) when (sbe.Reason == ServiceBusFailureReason.MessagingEntityAlreadyExists || sbe.IsTransient)
+ {
+ // carry on
+ }
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/ServiceControl.Transports/TransportSettings.cs b/src/ServiceControl.Transports/TransportSettings.cs
index 1e16d72476..246879e482 100644
--- a/src/ServiceControl.Transports/TransportSettings.cs
+++ b/src/ServiceControl.Transports/TransportSettings.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.Transports
{
using System;
+ using System.Collections.Generic;
using System.Runtime.Loader;
using NServiceBus.Settings;
@@ -18,6 +19,8 @@ public class TransportSettings : SettingsHolder
public bool RunCustomChecks { get; set; }
+ public IReadOnlySet EventTypesPublished { get; init; } = new HashSet();
+
public string ErrorQueue
{
set;
diff --git a/src/ServiceControl/ComponentInstallationContext.cs b/src/ServiceControl/ComponentInstallationContext.cs
index 5473bbd1fb..554a15219a 100644
--- a/src/ServiceControl/ComponentInstallationContext.cs
+++ b/src/ServiceControl/ComponentInstallationContext.cs
@@ -1,11 +1,17 @@
namespace Particular.ServiceControl
{
+ using System;
using System.Collections.Generic;
- class ComponentInstallationContext : IComponentInstallationContext
+ public class ComponentInstallationContext : IComponentInstallationContext
{
- public List Queues { get; } = [];
+ public IReadOnlyCollection Queues => queuesToCreate;
+ public IReadOnlySet EventTypesPublished => eventTypePublished;
- public void CreateQueue(string queueName) => Queues.Add(queueName);
+ public void CreateQueue(string queueName) => queuesToCreate.Add(queueName);
+ public void AddEventPublished() => eventTypePublished.Add(typeof(TEvent));
+
+ readonly List queuesToCreate = [];
+ readonly HashSet eventTypePublished = [];
}
}
\ No newline at end of file
diff --git a/src/ServiceControl/CustomChecks/CustomChecksComponent.cs b/src/ServiceControl/CustomChecks/CustomChecksComponent.cs
index a1e4087035..91b4adf178 100644
--- a/src/ServiceControl/CustomChecks/CustomChecksComponent.cs
+++ b/src/ServiceControl/CustomChecks/CustomChecksComponent.cs
@@ -1,16 +1,28 @@
namespace ServiceControl.CustomChecks
{
using Connection;
+ using Contracts;
using ExternalIntegrations;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using Particular.ServiceControl;
using ServiceBus.Management.Infrastructure.Settings;
using Transports;
class CustomChecksComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
+ public override void Setup(Settings settings, IComponentInstallationContext context, IHostApplicationBuilder hostBuilder)
+ {
+ // Integration Events
+ if (!settings.DisableExternalIntegrationsPublishing)
+ {
+ context.AddEventPublished();
+ context.AddEventPublished();
+ }
+ }
+
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
{
hostBuilder.Services.AddIntegrationEventPublisher();
hostBuilder.Services.AddIntegrationEventPublisher();
diff --git a/src/ServiceControl/EventLog/EventLogComponent.cs b/src/ServiceControl/EventLog/EventLogComponent.cs
index 797bf6d3e2..b539766ea0 100644
--- a/src/ServiceControl/EventLog/EventLogComponent.cs
+++ b/src/ServiceControl/EventLog/EventLogComponent.cs
@@ -2,6 +2,7 @@
{
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using Particular.ServiceControl;
using ServiceBus.Management.Infrastructure.Settings;
using ServiceControl.Infrastructure.DomainEvents;
@@ -9,7 +10,7 @@
class EventLogComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
{
var services = hostBuilder.Services;
services.AddSingleton();
diff --git a/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsComponent.cs b/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsComponent.cs
index 8c0cd12fcc..8bb1f8bce8 100644
--- a/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsComponent.cs
+++ b/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsComponent.cs
@@ -1,16 +1,26 @@
namespace ServiceControl.ExternalIntegrations
{
+ using Infrastructure.DomainEvents;
+ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using Particular.ServiceControl;
using ServiceBus.Management.Infrastructure.Settings;
using Transports;
class ExternalIntegrationsComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
{
var services = hostBuilder.Services;
services.AddEventLogMapping();
+
+ if (!settings.DisableExternalIntegrationsPublishing)
+ {
+ services.AddHostedService();
+ services.AddDomainEventHandler();
+ endpointConfiguration.EnableFeature();
+ }
}
}
}
\ No newline at end of file
diff --git a/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsHostBuilderExtensions.cs b/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsHostBuilderExtensions.cs
deleted file mode 100644
index 2c7f007dd6..0000000000
--- a/src/ServiceControl/ExternalIntegrations/ExternalIntegrationsHostBuilderExtensions.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace ServiceControl.ExternalIntegrations
-{
- using Infrastructure.DomainEvents;
- using Microsoft.Extensions.DependencyInjection;
- using Microsoft.Extensions.Hosting;
-
- static class ExternalIntegrationsHostBuilderExtensions
- {
- public static IHostApplicationBuilder AddExternalIntegrationEvents(this IHostApplicationBuilder hostBuilder)
- {
- var services = hostBuilder.Services;
- services.AddHostedService();
- services.AddDomainEventHandler();
- return hostBuilder;
- }
- }
-}
\ No newline at end of file
diff --git a/src/ServiceControl/HostApplicationBuilderExtensions.cs b/src/ServiceControl/HostApplicationBuilderExtensions.cs
index a2a26ef43c..956664ba3b 100644
--- a/src/ServiceControl/HostApplicationBuilderExtensions.cs
+++ b/src/ServiceControl/HostApplicationBuilderExtensions.cs
@@ -4,7 +4,6 @@ namespace Particular.ServiceControl
using System.Diagnostics;
using System.Runtime.InteropServices;
using global::ServiceControl.CustomChecks;
- using global::ServiceControl.ExternalIntegrations;
using global::ServiceControl.Hosting;
using global::ServiceControl.Infrastructure;
using global::ServiceControl.Infrastructure.BackgroundTasks;
@@ -45,8 +44,15 @@ public static void AddServiceControl(this IHostApplicationBuilder hostBuilder, S
hostBuilder.Logging.ClearProviders();
hostBuilder.Logging.ConfigureLogging(settings.LoggingSettings.LogLevel);
+ var componentSetupContext = new ComponentInstallationContext();
+ var serviceControlComponents = ServiceControlMainInstance.Components;
+ foreach (ServiceControlComponent component in serviceControlComponents)
+ {
+ component.Setup(settings, componentSetupContext, hostBuilder);
+ }
+
var services = hostBuilder.Services;
- var transportSettings = settings.ToTransportSettings();
+ var transportSettings = settings.ToTransportSettings(componentSetupContext);
var transportCustomization = TransportFactory.Create(transportSettings);
transportCustomization.AddTransportForPrimary(services, transportSettings);
@@ -81,11 +87,6 @@ public static void AddServiceControl(this IHostApplicationBuilder hostBuilder, S
NServiceBusFactory.Configure(settings, transportCustomization, transportSettings, configuration);
hostBuilder.UseNServiceBus(configuration);
- if (!settings.DisableExternalIntegrationsPublishing)
- {
- hostBuilder.AddExternalIntegrationEvents();
- }
-
hostBuilder.AddServicePulseSignalRNotifier();
hostBuilder.AddEmailNotifications();
hostBuilder.AddAsyncTimer();
@@ -101,7 +102,7 @@ public static void AddServiceControl(this IHostApplicationBuilder hostBuilder, S
hostBuilder.AddWindowsServiceWithRequestTimeout();
}
- hostBuilder.AddServiceControlComponents(settings, transportCustomization, ServiceControlMainInstance.Components);
+ hostBuilder.AddServiceControlComponents(componentSetupContext, settings, configuration, transportCustomization, serviceControlComponents);
}
public static void AddServiceControlInstallers(this IHostApplicationBuilder hostApplicationBuilder, Settings settings)
diff --git a/src/ServiceControl/Hosting/Commands/SetupCommand.cs b/src/ServiceControl/Hosting/Commands/SetupCommand.cs
index 3fdc2e7e11..5c6170da21 100644
--- a/src/ServiceControl/Hosting/Commands/SetupCommand.cs
+++ b/src/ServiceControl/Hosting/Commands/SetupCommand.cs
@@ -40,7 +40,7 @@ public override async Task Execute(HostArguments args, Settings settings)
}
else
{
- var transportSettings = settings.ToTransportSettings();
+ var transportSettings = settings.ToTransportSettings(componentSetupContext);
transportSettings.RunCustomChecks = false;
var transportCustomization = TransportFactory.Create(transportSettings);
diff --git a/src/ServiceControl/HostingComponent.cs b/src/ServiceControl/HostingComponent.cs
index df5d818048..d1ea34f032 100644
--- a/src/ServiceControl/HostingComponent.cs
+++ b/src/ServiceControl/HostingComponent.cs
@@ -5,11 +5,12 @@ namespace Particular.ServiceControl
using global::ServiceControl.Transports;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using ServiceBus.Management.Infrastructure.Settings;
class HostingComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
{
var services = hostBuilder.Services;
services.AddPlatformConnectionProvider();
diff --git a/src/ServiceControl/IComponentInstallationContext.cs b/src/ServiceControl/IComponentInstallationContext.cs
index b169d9482b..5f665bd533 100644
--- a/src/ServiceControl/IComponentInstallationContext.cs
+++ b/src/ServiceControl/IComponentInstallationContext.cs
@@ -1,7 +1,9 @@
namespace Particular.ServiceControl
{
- interface IComponentInstallationContext
+ public interface IComponentInstallationContext
{
void CreateQueue(string queueName);
+
+ void AddEventPublished();
}
}
\ No newline at end of file
diff --git a/src/ServiceControl/Infrastructure/NServiceBusFactory.cs b/src/ServiceControl/Infrastructure/NServiceBusFactory.cs
index 8818076cff..8243392f46 100644
--- a/src/ServiceControl/Infrastructure/NServiceBusFactory.cs
+++ b/src/ServiceControl/Infrastructure/NServiceBusFactory.cs
@@ -7,7 +7,6 @@ namespace ServiceBus.Management.Infrastructure
using NServiceBus;
using NServiceBus.Configuration.AdvancedExtensibility;
using ServiceControl.Configuration;
- using ServiceControl.ExternalIntegrations;
using ServiceControl.Infrastructure;
using ServiceControl.Infrastructure.Plugins;
using ServiceControl.Infrastructure.Subscriptions;
@@ -38,11 +37,6 @@ public static void Configure(Settings.Settings settings, ITransportCustomization
configuration.GetSettings().Set(settings.LoggingSettings);
configuration.SetDiagnosticsPath(settings.LoggingSettings.LogPath);
- if (!settings.DisableExternalIntegrationsPublishing)
- {
- configuration.EnableFeature();
- }
-
var recoverability = configuration.Recoverability();
recoverability.Immediate(c => c.NumberOfRetries(3));
recoverability.Delayed(c => c.NumberOfRetries(0));
diff --git a/src/ServiceControl/Infrastructure/Settings/Settings.cs b/src/ServiceControl/Infrastructure/Settings/Settings.cs
index d71b9dca66..ef46272162 100644
--- a/src/ServiceControl/Infrastructure/Settings/Settings.cs
+++ b/src/ServiceControl/Infrastructure/Settings/Settings.cs
@@ -9,6 +9,7 @@ namespace ServiceBus.Management.Infrastructure.Settings
using Microsoft.Extensions.Logging;
using NLog.Common;
using NServiceBus.Transport;
+ using Particular.ServiceControl;
using ServiceControl.Configuration;
using ServiceControl.Infrastructure;
using ServiceControl.Infrastructure.Settings;
@@ -238,7 +239,7 @@ public string GetConnectionString()
return connectionStringSettings?.ConnectionString;
}
- public TransportSettings ToTransportSettings()
+ public TransportSettings ToTransportSettings(ComponentInstallationContext installationContext)
{
var transportSettings = new TransportSettings
{
@@ -247,7 +248,8 @@ public TransportSettings ToTransportSettings()
MaxConcurrency = MaximumConcurrencyLevel,
RunCustomChecks = true,
TransportType = TransportType,
- AssemblyLoadContextResolver = AssemblyLoadContextResolver
+ AssemblyLoadContextResolver = AssemblyLoadContextResolver,
+ EventTypesPublished = installationContext.EventTypesPublished,
};
return transportSettings;
}
diff --git a/src/ServiceControl/Licensing/LicensingComponent.cs b/src/ServiceControl/Licensing/LicensingComponent.cs
index 736bf79779..059f7c47a2 100644
--- a/src/ServiceControl/Licensing/LicensingComponent.cs
+++ b/src/ServiceControl/Licensing/LicensingComponent.cs
@@ -4,13 +4,14 @@ namespace Particular.ServiceControl;
using global::ServiceControl.LicenseManagement;
using global::ServiceControl.Transports;
using Microsoft.Extensions.Hosting;
+using NServiceBus;
using Particular.LicensingComponent;
using Particular.LicensingComponent.Shared;
using ServiceBus.Management.Infrastructure.Settings;
class LicensingComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization,
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization,
IHostApplicationBuilder hostBuilder)
{
var licenseDetails = LicenseManager.FindLicense().Details;
diff --git a/src/ServiceControl/Monitoring/HeartbeatMonitoringComponent.cs b/src/ServiceControl/Monitoring/HeartbeatMonitoringComponent.cs
index eb6ed312e3..e7fbcd31bb 100644
--- a/src/ServiceControl/Monitoring/HeartbeatMonitoringComponent.cs
+++ b/src/ServiceControl/Monitoring/HeartbeatMonitoringComponent.cs
@@ -1,6 +1,7 @@
namespace ServiceControl.Monitoring
{
using Connection;
+ using Contracts;
using EndpointControl.Handlers;
using EventLog;
using ExternalIntegrations;
@@ -8,6 +9,7 @@
using Infrastructure.DomainEvents;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using Particular.ServiceControl;
using Persistence;
using Recoverability;
@@ -16,7 +18,17 @@
class HeartbeatMonitoringComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
+ public override void Setup(Settings settings, IComponentInstallationContext context, IHostApplicationBuilder hostBuilder)
+ {
+ // Integration Events
+ if (!settings.DisableExternalIntegrationsPublishing)
+ {
+ context.AddEventPublished();
+ context.AddEventPublished();
+ }
+ }
+
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
{
hostBuilder.Services.AddHostedService();
hostBuilder.Services.AddHostedService();
diff --git a/src/ServiceControl/Recoverability/RecoverabilityComponent.cs b/src/ServiceControl/Recoverability/RecoverabilityComponent.cs
index 8459008bb4..3e86d249d8 100644
--- a/src/ServiceControl/Recoverability/RecoverabilityComponent.cs
+++ b/src/ServiceControl/Recoverability/RecoverabilityComponent.cs
@@ -4,6 +4,7 @@
using System.Threading;
using System.Threading.Tasks;
using Connection;
+ using Contracts;
using Contracts.MessageFailures;
using CustomChecks;
using EventLog;
@@ -14,16 +15,48 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
+ using NServiceBus;
using Operations;
using Particular.ServiceControl;
using Persistence;
using Retrying;
using ServiceBus.Management.Infrastructure.Settings;
using Transports;
+ using FailedMessagesUnArchived = Contracts.FailedMessagesUnArchived;
+ using MessageEditedAndRetried = Contracts.MessageEditedAndRetried;
+ using MessageFailed = Contracts.MessageFailed;
+ using MessageFailureResolvedByRetry = Contracts.MessageFailureResolvedByRetry;
+ using MessageFailureResolvedManually = Contracts.MessageFailureResolvedManually;
class RecoverabilityComponent : ServiceControlComponent
{
- public override void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
+ public override void Setup(Settings settings, IComponentInstallationContext context, IHostApplicationBuilder hostBuilder)
+ {
+ context.CreateQueue(settings.StagingQueue);
+
+ if (settings.IngestErrorMessages)
+ {
+ context.CreateQueue(settings.ErrorQueue);
+ }
+
+ if (settings.ForwardErrorMessages && settings.ErrorLogQueue != null)
+ {
+ context.CreateQueue(settings.ErrorLogQueue);
+ }
+
+ // Integration Events
+ if (!settings.DisableExternalIntegrationsPublishing)
+ {
+ context.AddEventPublished();
+ context.AddEventPublished();
+ context.AddEventPublished();
+ context.AddEventPublished();
+ context.AddEventPublished();
+ context.AddEventPublished();
+ }
+ }
+
+ public override void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder)
{
var services = hostBuilder.Services;
services.AddPlatformConnectionProvider();
@@ -106,21 +139,6 @@ public override void Configure(Settings settings, ITransportCustomization transp
services.AddEventLogMapping();
}
- public override void Setup(Settings settings, IComponentInstallationContext context, IHostApplicationBuilder hostBuilder)
- {
- context.CreateQueue(settings.StagingQueue);
-
- if (settings.IngestErrorMessages)
- {
- context.CreateQueue(settings.ErrorQueue);
- }
-
- if (settings.ForwardErrorMessages && settings.ErrorLogQueue != null)
- {
- context.CreateQueue(settings.ErrorLogQueue);
- }
- }
-
class FailedMessageNotificationsHostedService : IHostedService
{
public FailedMessageNotificationsHostedService(
diff --git a/src/ServiceControl/ServiceControlComponent.cs b/src/ServiceControl/ServiceControlComponent.cs
index ef59783a9e..59bc768575 100644
--- a/src/ServiceControl/ServiceControlComponent.cs
+++ b/src/ServiceControl/ServiceControlComponent.cs
@@ -2,11 +2,12 @@ namespace Particular.ServiceControl
{
using global::ServiceControl.Transports;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using ServiceBus.Management.Infrastructure.Settings;
abstract class ServiceControlComponent
{
- public abstract void Configure(Settings settings, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder);
+ public abstract void Configure(Settings settings, EndpointConfiguration endpointConfiguration, ITransportCustomization transportCustomization, IHostApplicationBuilder hostBuilder);
public virtual void Setup(Settings settings, IComponentInstallationContext context, IHostApplicationBuilder hostBuilder)
{
diff --git a/src/ServiceControl/ServiceControlComponentHostBuilderExtensions.cs b/src/ServiceControl/ServiceControlComponentHostBuilderExtensions.cs
index 95c84116c2..5ea0065680 100644
--- a/src/ServiceControl/ServiceControlComponentHostBuilderExtensions.cs
+++ b/src/ServiceControl/ServiceControlComponentHostBuilderExtensions.cs
@@ -3,20 +3,19 @@ namespace Particular.ServiceControl
using global::ServiceControl.Transports;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+ using NServiceBus;
using ServiceBus.Management.Infrastructure.Settings;
static class ServiceControlComponentHostBuilderExtensions
{
- public static void AddServiceControlComponents(this IHostApplicationBuilder hostBuilder, Settings settings,
+ public static void AddServiceControlComponents(this IHostApplicationBuilder hostBuilder, ComponentInstallationContext componentContext, Settings settings, EndpointConfiguration endpointConfiguration,
ITransportCustomization transportCustomization,
params ServiceControlComponent[] components)
{
- var componentContext = new ComponentInstallationContext();
hostBuilder.Services.AddSingleton(componentContext);
foreach (var component in components)
{
- component.Setup(settings, componentContext, hostBuilder);
- component.Configure(settings, transportCustomization, hostBuilder);
+ component.Configure(settings, endpointConfiguration, transportCustomization, hostBuilder);
}
}
}