Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix installers #1184

Merged
merged 1 commit into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view

This file was deleted.

25 changes: 25 additions & 0 deletions src/ServiceControl/Infrastructure/Installers/AuditLoqQueue.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace ServiceBus.Management.Infrastructure.Installers
{
using NServiceBus.Features;
using NServiceBus.Transport;
using ServiceBus.Management.Infrastructure.Settings;

public class AuditLoqQueue : Feature
{
public AuditLoqQueue()
{
Prerequisite(c =>
{
var settings = c.Settings.Get<Settings>("ServiceControl.Settings");
return settings.ForwardAuditMessages && settings.AuditLogQueue != null;
}, "Audit Log queue not enabled.");
}

protected override void Setup(FeatureConfigurationContext context)
{
var settings = context.Settings.Get<Settings>("ServiceControl.Settings");
var queueBindings = context.Settings.Get<QueueBindings>();
queueBindings.BindSending(settings.AuditLogQueue);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
namespace ServiceBus.Management.Infrastructure.Installers
{
using NServiceBus;
using NServiceBus.Unicast.Queuing;
using NServiceBus.Features;
using NServiceBus.Transport;
using Settings;

public class ErrorLogQueueInstaller : IWantQueueCreated
public class ErrorLoqQueue : Feature
{
public Settings Settings { get; set; }

public bool ShouldCreateQueue()
public ErrorLoqQueue()
{
return Settings.ForwardErrorMessages && Settings.ErrorLogQueue != Address.Undefined;
Prerequisite(c =>
{
var settings = c.Settings.Get<Settings>("ServiceControl.Settings");
return settings.ForwardErrorMessages && settings.ErrorLogQueue != null;
}, "Error Log queue not enabled.");
}

public Address Address => Settings.ErrorLogQueue;
protected override void Setup(FeatureConfigurationContext context)
{
var settings = context.Settings.Get<Settings>("ServiceControl.Settings");
var queueBindings = context.Settings.Get<QueueBindings>();
queueBindings.BindSending(settings.ErrorLogQueue);
}
}
}
2 changes: 1 addition & 1 deletion src/ServiceControl/ServiceControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@
<Compile Include="Infrastructure\DomainEvents\IDomainEvent.cs" />
<Compile Include="Infrastructure\DomainEvents\IDomainEvents.cs" />
<Compile Include="Infrastructure\DomainEvents\IDomainHandler.cs" />
<Compile Include="Infrastructure\Installers\AuditLoqQueue.cs" />
<Compile Include="Infrastructure\MarkerFile.cs" />
<Compile Include="Infrastructure\RavenDB\Extensions.cs" />
<Compile Include="Infrastructure\RavenDB\Subscriptions\LegacyAddress.cs" />
Expand Down Expand Up @@ -516,7 +517,6 @@
<Compile Include="EventLog\EventLogItem.cs" />
<Compile Include="HeartbeatMonitoring\RegisterEndpointStartupHandler.cs" />
<Compile Include="Infrastructure\DeterministicGuid.cs" />
<Compile Include="Infrastructure\Installers\AuditLogQueueInstaller.cs" />
<Compile Include="Infrastructure\Installers\CreateEventSource.cs" />
<Compile Include="Infrastructure\Plugins\RegisterPluginMessages.cs" />
<Compile Include="Infrastructure\RavenDB\Expiration\ExpiredDocumentsCleanerBundle.cs" />
Expand Down