diff --git a/src/ServiceControl.AcceptanceTests/ConfigureEndpointSQSTransport.cs b/src/ServiceControl.AcceptanceTests/ConfigureEndpointSQSTransport.cs index 00853bf5b3..4b696896c8 100644 --- a/src/ServiceControl.AcceptanceTests/ConfigureEndpointSQSTransport.cs +++ b/src/ServiceControl.AcceptanceTests/ConfigureEndpointSQSTransport.cs @@ -1,7 +1,12 @@ -using System.Threading.Tasks; +using System; +using System.Threading.Tasks; +using Amazon.Runtime; +using Amazon.S3; +using Amazon.SQS; using NServiceBus; using NServiceBus.AcceptanceTesting.Support; using ServiceBus.Management.AcceptanceTests; +using ServiceControl.Transports.SQS; public class ConfigureEndpointSQSTransport : ITransportIntegration { @@ -10,6 +15,15 @@ public Task Configure(string endpointName, EndpointConfiguration configuration, configuration.UseSerialization(); var transportConfig = configuration.UseTransport(); + transportConfig.ClientFactory(CreateSQSClient); + + S3BucketName = Environment.GetEnvironmentVariable(S3BucketEnvironmentVariableName); + + if (!string.IsNullOrEmpty(S3BucketName)) + { + var s3Configuration = transportConfig.S3(S3BucketName, S3Prefix); + s3Configuration.ClientFactory(CreateS3Client); + } var routing = transportConfig.Routing(); foreach (var publisher in publisherMetadata.Publishers) @@ -30,7 +44,24 @@ public Task Cleanup() public string Name => "SQS"; - public string TypeName => $"{typeof(ServiceControl.Transports.SQS.SQSTransportCustomization).AssemblyQualifiedName}"; + public string TypeName => $"{typeof(SQSTransportCustomization).AssemblyQualifiedName}"; public string ConnectionString { get; set; } + + static IAmazonSQS CreateSQSClient() + { + var credentials = new EnvironmentVariablesAWSCredentials(); + return new AmazonSQSClient(credentials); + } + + static IAmazonS3 CreateS3Client() + { + var credentials = new EnvironmentVariablesAWSCredentials(); + return new AmazonS3Client(credentials); + } + + const string S3Prefix = "test"; + + const string S3BucketEnvironmentVariableName = "NServiceBus_AmazonSQS_S3Bucket"; + static string S3BucketName; } \ No newline at end of file diff --git a/src/ServiceControl.AcceptanceTests/ServiceControl.AcceptanceTests.csproj b/src/ServiceControl.AcceptanceTests/ServiceControl.AcceptanceTests.csproj index fb578b5e7d..b7dd555435 100644 --- a/src/ServiceControl.AcceptanceTests/ServiceControl.AcceptanceTests.csproj +++ b/src/ServiceControl.AcceptanceTests/ServiceControl.AcceptanceTests.csproj @@ -36,7 +36,7 @@ - + diff --git a/src/ServiceControl.LoadTests.AuditGenerator/ServiceControl.LoadTests.AuditGenerator.csproj b/src/ServiceControl.LoadTests.AuditGenerator/ServiceControl.LoadTests.AuditGenerator.csproj index 904c7f29db..e7b3a65f3b 100644 --- a/src/ServiceControl.LoadTests.AuditGenerator/ServiceControl.LoadTests.AuditGenerator.csproj +++ b/src/ServiceControl.LoadTests.AuditGenerator/ServiceControl.LoadTests.AuditGenerator.csproj @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/ServiceControl.Transports.ASB/ASBEndpointTopologyTransportCustomization.cs b/src/ServiceControl.Transports.ASB/ASBEndpointTopologyTransportCustomization.cs index d29c826adf..396720797a 100644 --- a/src/ServiceControl.Transports.ASB/ASBEndpointTopologyTransportCustomization.cs +++ b/src/ServiceControl.Transports.ASB/ASBEndpointTopologyTransportCustomization.cs @@ -15,6 +15,8 @@ public override void CustomizeEndpoint(EndpointConfiguration endpointConfig, Tra var transport = endpointConfig.UseTransport(); transport.Sanitization().UseStrategy(); var topology = transport.UseEndpointOrientedTopology(); + topology.EnableMigrationToForwardingTopology(); + foreach (var remoteInstance in remoteInstances) { foreach (var remoteType in remoteTypesToSubscribeTo) diff --git a/src/ServiceControl.Transports.ASB/ServiceControl.Transports.ASB.csproj b/src/ServiceControl.Transports.ASB/ServiceControl.Transports.ASB.csproj index 790cc198b6..ce7d470855 100644 --- a/src/ServiceControl.Transports.ASB/ServiceControl.Transports.ASB.csproj +++ b/src/ServiceControl.Transports.ASB/ServiceControl.Transports.ASB.csproj @@ -9,9 +9,9 @@ - + - + diff --git a/src/ServiceControl.Transports.ASBS/ServiceControl.Transports.ASBS.csproj b/src/ServiceControl.Transports.ASBS/ServiceControl.Transports.ASBS.csproj index b464a52d4a..94f2518fd0 100644 --- a/src/ServiceControl.Transports.ASBS/ServiceControl.Transports.ASBS.csproj +++ b/src/ServiceControl.Transports.ASBS/ServiceControl.Transports.ASBS.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/ServiceControl.Transports.ASQ/ServiceControl.Transports.ASQ.csproj b/src/ServiceControl.Transports.ASQ/ServiceControl.Transports.ASQ.csproj index 00a6cabca1..276c4d3a28 100644 --- a/src/ServiceControl.Transports.ASQ/ServiceControl.Transports.ASQ.csproj +++ b/src/ServiceControl.Transports.ASQ/ServiceControl.Transports.ASQ.csproj @@ -10,7 +10,7 @@ - + diff --git a/src/ServiceControl.Transports.SQS/SQSTransportCustomization.cs b/src/ServiceControl.Transports.SQS/SQSTransportCustomization.cs index 15ceb0432e..96514e33bf 100644 --- a/src/ServiceControl.Transports.SQS/SQSTransportCustomization.cs +++ b/src/ServiceControl.Transports.SQS/SQSTransportCustomization.cs @@ -5,6 +5,8 @@ using System.Linq; using System.Reflection; using Amazon; + using Amazon.Runtime; + using Amazon.SQS; using NServiceBus; using NServiceBus.Configuration.AdvancedExtensibility; using NServiceBus.Logging; @@ -34,6 +36,9 @@ static void ConfigureTransport(TransportExtensions transport, Tran { PromoteEnvironmentVariableFromConnectionString(builder, "AccessKeyId", "AWS_ACCESS_KEY_ID"); PromoteEnvironmentVariableFromConnectionString(builder, "SecretAccessKey", "AWS_SECRET_ACCESS_KEY"); + + // if the user provided the access key and secret access key they should always be loaded from environment credentials + transport.ClientFactory(() => new AmazonSQSClient(new EnvironmentVariablesAWSCredentials())); } else { diff --git a/src/ServiceControl.Transports.SQS/ServiceControl.Transports.SQS.csproj b/src/ServiceControl.Transports.SQS/ServiceControl.Transports.SQS.csproj index 8e4d231cd4..370c6be9c6 100644 --- a/src/ServiceControl.Transports.SQS/ServiceControl.Transports.SQS.csproj +++ b/src/ServiceControl.Transports.SQS/ServiceControl.Transports.SQS.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.TransportNames.approved.txt b/src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.TransportNames.approved.txt index aa3f747993..9a7b007316 100644 --- a/src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.TransportNames.approved.txt +++ b/src/ServiceControl.UnitTests/ApprovalFiles/APIApprovals.TransportNames.approved.txt @@ -2,12 +2,14 @@ [assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0", FrameworkDisplayName=".NET Framework 4")] namespace ServiceControlInstaller.Engine.Instances { - public class TransportNames + public class static TransportNames { public const string AmazonSQS = "AmazonSQS"; public const string AzureServiceBus = "Azure Service Bus"; - public const string AzureServiceBusEndpointOrientedTopology = "Azure Service Bus - Endpoint-oriented topology (Old)"; - public const string AzureServiceBusForwardingTopology = "Azure Service Bus - Forwarding topology (Old)"; + public const string AzureServiceBusEndpointOrientedTopology = "Azure Service Bus - Endpoint-oriented topology (Legacy)"; + public const string AzureServiceBusEndpointOrientedTopologyOld = "Azure Service Bus - Endpoint-oriented topology (Old)"; + public const string AzureServiceBusForwardingTopology = "Azure Service Bus - Forwarding topology (Legacy)"; + public const string AzureServiceBusForwardingTopologyOld = "Azure Service Bus - Forwarding topology (Old)"; public const string AzureStorageQueue = "Azure Storage Queue"; public const string MSMQ = "MSMQ"; public const string RabbitMQConventionalRoutingTopology = "RabbitMQ - Conventional routing topology"; diff --git a/src/ServiceControl.UnitTests/ServiceControl.UnitTests.csproj b/src/ServiceControl.UnitTests/ServiceControl.UnitTests.csproj index 06f878a4a4..afa5d4a19f 100644 --- a/src/ServiceControl.UnitTests/ServiceControl.UnitTests.csproj +++ b/src/ServiceControl.UnitTests/ServiceControl.UnitTests.csproj @@ -22,7 +22,7 @@ - + diff --git a/src/ServiceControl/Infrastructure/AsyncTimer.cs b/src/ServiceControl/Infrastructure/AsyncTimer.cs index 30e1e21930..80c9559e83 100644 --- a/src/ServiceControl/Infrastructure/AsyncTimer.cs +++ b/src/ServiceControl/Infrastructure/AsyncTimer.cs @@ -25,31 +25,36 @@ void Start(Func> callback, Time task = Task.Run(async () => { - await Task.Delay(due, token).ConfigureAwait(false); - while (!token.IsCancellationRequested) + try { - try + await Task.Delay(due, token).ConfigureAwait(false); + + while (!token.IsCancellationRequested) { - var result = await callback(token).ConfigureAwait(false); - if (result == TimerJobExecutionResult.DoNotContinueExecuting) + try { - tokenSource.Cancel(); + var result = await callback(token).ConfigureAwait(false); + if (result == TimerJobExecutionResult.DoNotContinueExecuting) + { + tokenSource.Cancel(); + } + else if (result == TimerJobExecutionResult.ScheduleNextExecution) + { + await Task.Delay(interval, token).ConfigureAwait(false); + } + //Otherwise execute immediately } - else if (result == TimerJobExecutionResult.ScheduleNextExecution) + catch (Exception ex) { - await Task.Delay(interval, token).ConfigureAwait(false); + errorCallback(ex); } - //Otherwise execute immediately - } - catch (OperationCanceledException) - { - // no-op - } - catch (Exception ex) - { - errorCallback(ex); } } + catch (OperationCanceledException) + { + // no-op + } + }, CancellationToken.None); } diff --git a/src/ServiceControl/Infrastructure/Nancy/JsonNetBodyDeserializer.cs b/src/ServiceControl/Infrastructure/Nancy/JsonNetBodyDeserializer.cs index 76c4526201..624ff6429d 100644 --- a/src/ServiceControl/Infrastructure/Nancy/JsonNetBodyDeserializer.cs +++ b/src/ServiceControl/Infrastructure/Nancy/JsonNetBodyDeserializer.cs @@ -10,6 +10,7 @@ using global::Nancy.ModelBinding; using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using Newtonsoft.Json.Serialization; using ServiceControl.Infrastructure.SignalR; class JsonNetBodyDeserializer : IBodyDeserializer @@ -24,8 +25,8 @@ public JsonNetBodyDeserializer() ContractResolver = new UnderscoreMappingResolver(), Converters = { - new IsoDateTimeConverter {DateTimeStyles = DateTimeStyles.RoundtripKind}, - new StringEnumConverter {CamelCaseText = true} + new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.RoundtripKind }, + new StringEnumConverter { NamingStrategy = new CamelCaseNamingStrategy() } } }; serializer = JsonSerializer.Create(serializerSettings); diff --git a/src/ServiceControl/Infrastructure/Nancy/JsonNetSerializer.cs b/src/ServiceControl/Infrastructure/Nancy/JsonNetSerializer.cs index 779078e23c..fd61857ceb 100644 --- a/src/ServiceControl/Infrastructure/Nancy/JsonNetSerializer.cs +++ b/src/ServiceControl/Infrastructure/Nancy/JsonNetSerializer.cs @@ -8,6 +8,7 @@ using global::Nancy.IO; using Newtonsoft.Json; using Newtonsoft.Json.Converters; + using Newtonsoft.Json.Serialization; using ServiceControl.Infrastructure.SignalR; class JsonNetSerializer : ISerializer @@ -93,7 +94,7 @@ public static JsonSerializerSettings CreateDefault() }, new StringEnumConverter { - CamelCaseText = true + NamingStrategy = new CamelCaseNamingStrategy() } } }; diff --git a/src/ServiceControl/Infrastructure/Settings/Settings.cs b/src/ServiceControl/Infrastructure/Settings/Settings.cs index 9918e3b1ac..e962ee3c69 100644 --- a/src/ServiceControl/Infrastructure/Settings/Settings.cs +++ b/src/ServiceControl/Infrastructure/Settings/Settings.cs @@ -216,13 +216,13 @@ public TransportCustomization LoadTransportCustomization() private string GetAuditLogQueue() { - var value = SettingsReader.Read("ServiceBus", "AuditLogQueue", null); - if (AuditQueue == null) { return null; } - + + var value = SettingsReader.Read("ServiceBus", "AuditLogQueue", null); + if (value == null) { logger.Info("No settings found for audit log queue to import, default name will be used"); @@ -275,14 +275,14 @@ private string GetErrorQueue() } private string GetErrorLogQueue() - { - var value = SettingsReader.Read("ServiceBus", "ErrorLogQueue", null); - + { if (ErrorQueue == null) { return null; } + var value = SettingsReader.Read("ServiceBus", "ErrorLogQueue", null); + if (value == null) { logger.Info("No settings found for error log queue to import, default name will be used"); @@ -513,4 +513,4 @@ static string Subscope(string address) const int ExpirationProcessBatchSizeMinimum = 10240; const int MaxBodySizeToStoreDefault = 102400; //100 kb } -} \ No newline at end of file +} diff --git a/src/ServiceControl/Licensing/LicenseCheckFeature.cs b/src/ServiceControl/Licensing/LicenseCheckFeature.cs index 94277577df..124e18734c 100644 --- a/src/ServiceControl/Licensing/LicenseCheckFeature.cs +++ b/src/ServiceControl/Licensing/LicenseCheckFeature.cs @@ -26,6 +26,7 @@ class LicenseCheckFeatureStartup : FeatureStartupTask public LicenseCheckFeatureStartup(ActiveLicense activeLicense) { this.activeLicense = activeLicense; + ScheduleNextExecutionTask = Task.FromResult(TimerJobExecutionResult.ScheduleNextExecution); } protected override Task OnStart(IMessageSession session) @@ -34,11 +35,8 @@ protected override Task OnStart(IMessageSession session) timer = new AsyncTimer(_ => { activeLicense.Refresh(); - return Task.FromResult(TimerJobExecutionResult.ScheduleNextExecution); - }, due, due, ex => - { - log.Error("Unhandled error while refreshing the license.", ex); - }); + return ScheduleNextExecutionTask; + }, due, due, ex => { log.Error("Unhandled error while refreshing the license.", ex); }); return Task.FromResult(0); } @@ -47,8 +45,10 @@ protected override Task OnStop(IMessageSession session) return timer.Stop(); } - static ILog log = LogManager.GetLogger(); ActiveLicense activeLicense; AsyncTimer timer; + + static ILog log = LogManager.GetLogger(); + static Task ScheduleNextExecutionTask; } } \ No newline at end of file diff --git a/src/ServiceControl/Operations/AuditIngestor.cs b/src/ServiceControl/Operations/AuditIngestor.cs index 999bcf9aed..a53e5ff7c4 100644 --- a/src/ServiceControl/Operations/AuditIngestor.cs +++ b/src/ServiceControl/Operations/AuditIngestor.cs @@ -30,6 +30,6 @@ await messageForwarder.Forward(context, settings.AuditLogQueue) AuditPersister auditPersister; IForwardMessages messageForwarder; Settings settings; - static ILog log = LogManager.GetLogger(); + static ILog log = LogManager.GetLogger(); } -} \ No newline at end of file +} diff --git a/src/ServiceControl/ServiceControl.csproj b/src/ServiceControl/ServiceControl.csproj index fde9908eaf..1eae3a7701 100644 --- a/src/ServiceControl/ServiceControl.csproj +++ b/src/ServiceControl/ServiceControl.csproj @@ -24,7 +24,7 @@ - + diff --git a/src/ServiceControlInstaller.Engine/Instances/MonitoringTransports.cs b/src/ServiceControlInstaller.Engine/Instances/MonitoringTransports.cs index 9ffa227327..d649c9289e 100644 --- a/src/ServiceControlInstaller.Engine/Instances/MonitoringTransports.cs +++ b/src/ServiceControlInstaller.Engine/Instances/MonitoringTransports.cs @@ -10,7 +10,7 @@ public class MonitoringTransports { //INFO: Those types are used in the SCMU and in PS scripts. In both cases Match predicate is used to find a transport info. // In the UI the matching is done based on the transport TypeName from app.config. In PS it's done based on human friendly names. - // As a result the Match predicate should evalute to true both for TypeName and human friendly name. + // As a result the Match predicate should evaluate to true both for TypeName and human friendly name. // Matching separately on Name and TypeName would not be enough because we need to be backwards compatible. // As a result Match is comparing to old/current names, old/current types. new TransportInfo @@ -18,8 +18,8 @@ public class MonitoringTransports Name = TransportNames.AmazonSQS, ZipName = "AmazonSQS", TypeName = "ServiceControl.Transports.AmazonSQS.ServiceControlSqsTransport, ServiceControl.Transports.AmazonSQS", - SampleConnectionString = "AccessKeyId=;SecretAccessKey=;Region=;QueueNamePrefix=", - Help = "'AccessKeyId', 'SecretAccessKey' and 'Region' are mandatory configurations.", + SampleConnectionString = "Region=;QueueNamePrefix=;AccessKeyId=;SecretAccessKey=", + Help = "'Region' is mandatory. Specify 'AccessKeyId' and 'SecretAccessKey' values to set the AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY environment variables if not using IAM roles or EC2 metadata.", Matches = name => name.Equals(TransportNames.AmazonSQS, StringComparison.OrdinalIgnoreCase) || name.Equals("ServiceControl.Transports.AmazonSQS.ServiceControlSqsTransport, ServiceControl.Transports.AmazonSQS", StringComparison.OrdinalIgnoreCase) || name.Equals("NServiceBus.SqsTransport, NServiceBus.AmazonSQS", StringComparison.OrdinalIgnoreCase) @@ -31,6 +31,7 @@ public class MonitoringTransports TypeName = "ServiceControl.Transports.LegacyAzureServiceBus.EndpointOrientedTopologyAzureServiceBusTransport, ServiceControl.Transports.LegacyAzureServiceBus", SampleConnectionString = "Endpoint=sb://[namespace].servicebus.windows.net; SharedSecretIssuer=;SharedSecretValue=", Matches = name => name.Equals(TransportNames.AzureServiceBusEndpointOrientedTopology, StringComparison.OrdinalIgnoreCase) + || name.Equals(TransportNames.AzureServiceBusEndpointOrientedTopologyOld, StringComparison.OrdinalIgnoreCase) || name.Equals("ServiceControl.Transports.LegacyAzureServiceBus.EndpointOrientedTopologyAzureServiceBusTransport, ServiceControl.Transports.LegacyAzureServiceBus", StringComparison.OrdinalIgnoreCase) }, new TransportInfo @@ -40,6 +41,7 @@ public class MonitoringTransports TypeName = "ServiceControl.Transports.LegacyAzureServiceBus.ForwardingTopologyAzureServiceBusTransport, ServiceControl.Transports.LegacyAzureServiceBus", SampleConnectionString = "Endpoint=sb://[namespace].servicebus.windows.net; SharedSecretIssuer=;SharedSecretValue=", Matches = name => name.Equals(TransportNames.AzureServiceBusForwardingTopology, StringComparison.OrdinalIgnoreCase) + || name.Equals(TransportNames.AzureServiceBusForwardingTopologyOld, StringComparison.OrdinalIgnoreCase) || name.Equals("AzureServiceBus", StringComparison.OrdinalIgnoreCase) || name.Equals("NServiceBus.AzureServiceBusTransport, NServiceBus.Azure.Transports.WindowsAzureServiceBus", StringComparison.OrdinalIgnoreCase) || name.Equals("ServiceControl.Transports.LegacyAzureServiceBus.ForwardingTopologyAzureServiceBusTransport, ServiceControl.Transports.LegacyAzureServiceBus", StringComparison.OrdinalIgnoreCase) diff --git a/src/ServiceControlInstaller.Engine/Instances/ServiceControlCoreTransports.cs b/src/ServiceControlInstaller.Engine/Instances/ServiceControlCoreTransports.cs index a29c423c58..69edf03bf8 100644 --- a/src/ServiceControlInstaller.Engine/Instances/ServiceControlCoreTransports.cs +++ b/src/ServiceControlInstaller.Engine/Instances/ServiceControlCoreTransports.cs @@ -25,6 +25,7 @@ public class ServiceControlCoreTransports ZipName = "AzureServiceBus", SampleConnectionString = "Endpoint=sb://[namespace].servicebus.windows.net; SharedSecretIssuer=;SharedSecretValue=", Matches = name => name.Equals(TransportNames.AzureServiceBusEndpointOrientedTopology, StringComparison.OrdinalIgnoreCase) + || name.Equals(TransportNames.AzureServiceBusEndpointOrientedTopologyOld, StringComparison.OrdinalIgnoreCase) || name.Equals("AzureServiceBus", StringComparison.OrdinalIgnoreCase) || name.Equals("ServiceControl.Transports.ASB.ASBEndpointTopologyTransportCustomization, ServiceControl.Transports.ASB", StringComparison.OrdinalIgnoreCase) || name.Equals("NServiceBus.AzureServiceBusTransport, NServiceBus.Azure.Transports.WindowsAzureServiceBus", StringComparison.OrdinalIgnoreCase) @@ -36,6 +37,7 @@ public class ServiceControlCoreTransports ZipName = "AzureServiceBus", SampleConnectionString = "Endpoint=sb://[namespace].servicebus.windows.net; SharedSecretIssuer=;SharedSecretValue=", Matches = name => name.Equals(TransportNames.AzureServiceBusForwardingTopology, StringComparison.OrdinalIgnoreCase) + || name.Equals(TransportNames.AzureServiceBusForwardingTopologyOld, StringComparison.OrdinalIgnoreCase) || name.Equals("ServiceControl.Transports.ASB.ASBForwardingTopologyTransportCustomization, ServiceControl.Transports.ASB", StringComparison.OrdinalIgnoreCase) }, new TransportInfo diff --git a/src/ServiceControlInstaller.Engine/Instances/TransportNames.cs b/src/ServiceControlInstaller.Engine/Instances/TransportNames.cs index 499d8110bb..ffae570457 100644 --- a/src/ServiceControlInstaller.Engine/Instances/TransportNames.cs +++ b/src/ServiceControlInstaller.Engine/Instances/TransportNames.cs @@ -1,12 +1,16 @@ -namespace ServiceControlInstaller.Engine.Instances +namespace ServiceControlInstaller.Engine.Instances { - public class TransportNames + public static class TransportNames { public const string AzureServiceBus = "Azure Service Bus"; - public const string AzureServiceBusEndpointOrientedTopology = "Azure Service Bus - Endpoint-oriented topology (Old)"; - - public const string AzureServiceBusForwardingTopology = "Azure Service Bus - Forwarding topology (Old)"; + public const string AzureServiceBusEndpointOrientedTopology = "Azure Service Bus - Endpoint-oriented topology (Legacy)"; + // for backward compatibility + public const string AzureServiceBusEndpointOrientedTopologyOld = "Azure Service Bus - Endpoint-oriented topology (Old)"; + + public const string AzureServiceBusForwardingTopology = "Azure Service Bus - Forwarding topology (Legacy)"; + // for backward compatibility + public const string AzureServiceBusForwardingTopologyOld = "Azure Service Bus - Forwarding topology (Old)"; public const string AmazonSQS = "AmazonSQS"; @@ -19,7 +23,5 @@ public class TransportNames public const string RabbitMQConventionalRoutingTopology = "RabbitMQ - Conventional routing topology"; public const string RabbitMQDirectRoutingTopology = "RabbitMQ - Direct routing topology (Old)"; - - TransportNames() { } } } \ No newline at end of file diff --git a/src/ServiceControlInstaller.Packaging/ServiceControlInstaller.Packaging.csproj b/src/ServiceControlInstaller.Packaging/ServiceControlInstaller.Packaging.csproj index 43f37131bb..f28925de08 100644 --- a/src/ServiceControlInstaller.Packaging/ServiceControlInstaller.Packaging.csproj +++ b/src/ServiceControlInstaller.Packaging/ServiceControlInstaller.Packaging.csproj @@ -17,7 +17,7 @@ - + diff --git a/src/ServiceControlInstaller.PowerShell/Cmdlets/MonitoringInstances/NewMonitoringInstance.cs b/src/ServiceControlInstaller.PowerShell/Cmdlets/MonitoringInstances/NewMonitoringInstance.cs index 5fd632931f..948b1f4eef 100644 --- a/src/ServiceControlInstaller.PowerShell/Cmdlets/MonitoringInstances/NewMonitoringInstance.cs +++ b/src/ServiceControlInstaller.PowerShell/Cmdlets/MonitoringInstances/NewMonitoringInstance.cs @@ -44,7 +44,7 @@ public class NewMonitoringInstance : PSCmdlet public string ErrorQueue { get; set; } [Parameter(Mandatory = true, HelpMessage = "Specify the NServiceBus Transport to use")] - [ValidateSet(TransportNames.AzureServiceBusForwardingTopology, TransportNames.AzureServiceBusEndpointOrientedTopology, TransportNames.AzureServiceBus, TransportNames.AzureStorageQueue, TransportNames.MSMQ, TransportNames.SQLServer, TransportNames.RabbitMQDirectRoutingTopology, TransportNames.RabbitMQConventionalRoutingTopology, TransportNames.AmazonSQS)] + [ValidateSet(TransportNames.AzureServiceBusForwardingTopology, TransportNames.AzureServiceBusForwardingTopologyOld, TransportNames.AzureServiceBusEndpointOrientedTopology, TransportNames.AzureServiceBusEndpointOrientedTopologyOld, TransportNames.AzureServiceBus, TransportNames.AzureStorageQueue, TransportNames.MSMQ, TransportNames.SQLServer, TransportNames.RabbitMQDirectRoutingTopology, TransportNames.RabbitMQConventionalRoutingTopology, TransportNames.AmazonSQS)] public string Transport { get; set; } [Parameter(Mandatory = false, HelpMessage = "Specify the Windows Service Display name. If unspecified the instance name will be used")] diff --git a/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlInstance.cs b/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlInstance.cs index eb19ae53f3..d3ac883f52 100644 --- a/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlInstance.cs +++ b/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlInstance.cs @@ -64,7 +64,7 @@ public class NewServiceControlInstance : PSCmdlet public string AuditLogQueue { get; set; } [Parameter(Mandatory = true, HelpMessage = "Specify the NServiceBus Transport to use")] - [ValidateSet(TransportNames.AzureServiceBus, TransportNames.AzureServiceBusForwardingTopology, TransportNames.AzureServiceBusEndpointOrientedTopology, TransportNames.AzureStorageQueue, TransportNames.MSMQ, TransportNames.SQLServer, TransportNames.RabbitMQDirectRoutingTopology, TransportNames.RabbitMQConventionalRoutingTopology, TransportNames.AmazonSQS)] + [ValidateSet(TransportNames.AzureServiceBus, TransportNames.AzureServiceBusForwardingTopology, TransportNames.AzureServiceBusForwardingTopologyOld, TransportNames.AzureServiceBusEndpointOrientedTopology, TransportNames.AzureServiceBusEndpointOrientedTopologyOld, TransportNames.AzureStorageQueue, TransportNames.MSMQ, TransportNames.SQLServer, TransportNames.RabbitMQDirectRoutingTopology, TransportNames.RabbitMQConventionalRoutingTopology, TransportNames.AmazonSQS)] public string Transport { get; set; } [Parameter(Mandatory = false, HelpMessage = "Specify the Windows Service Display name. If unspecified the instance name will be used")] diff --git a/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlUnattendedFile.cs b/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlUnattendedFile.cs index cfd01a47ce..0bd410af6a 100644 --- a/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlUnattendedFile.cs +++ b/src/ServiceControlInstaller.PowerShell/Cmdlets/ServiceControlInstances/NewServiceControlUnattendedFile.cs @@ -61,7 +61,7 @@ public class NewServiceControlUnattendedFile : PSCmdlet public string AuditLogQueue { get; set; } [Parameter(Mandatory = true, HelpMessage = "Specify the NServiceBus Transport to use")] - [ValidateSet(TransportNames.AzureServiceBus, TransportNames.AzureServiceBusForwardingTopology, TransportNames.AzureServiceBusEndpointOrientedTopology, TransportNames.AzureStorageQueue, TransportNames.MSMQ, TransportNames.SQLServer, TransportNames.RabbitMQDirectRoutingTopology, TransportNames.RabbitMQConventionalRoutingTopology, TransportNames.AmazonSQS)] + [ValidateSet(TransportNames.AzureServiceBus, TransportNames.AzureServiceBusForwardingTopology, TransportNames.AzureServiceBusForwardingTopologyOld, TransportNames.AzureServiceBusEndpointOrientedTopology, TransportNames.AzureServiceBusEndpointOrientedTopologyOld, TransportNames.AzureStorageQueue, TransportNames.MSMQ, TransportNames.SQLServer, TransportNames.RabbitMQDirectRoutingTopology, TransportNames.RabbitMQConventionalRoutingTopology, TransportNames.AmazonSQS)] public string Transport { get; set; } [Parameter(Mandatory = false, HelpMessage = "Specify the Windows Service Display name. If unspecified the instance name will be used")]