-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1184 from Particular/installers
Fix installers
- Loading branch information
Showing
4 changed files
with
41 additions
and
27 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
src/ServiceControl/Infrastructure/Installers/AuditLogQueueInstaller.cs
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
src/ServiceControl/Infrastructure/Installers/AuditLoqQueue.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
23 changes: 15 additions & 8 deletions
23
src/ServiceControl/Infrastructure/Installers/ErrorLogQueueInstaller.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters