Skip to content

Hotfix 3.1.2 #1411

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

Merged
merged 7 commits into from
Sep 21, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="NServiceBus.AmazonSQS" Version="4.1.0" />
<PackageReference Include="NServiceBus.AmazonSQS" Version="4.1.1" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="2.1.0" />
<PackageReference Include="Particular.CodeRules" Version="0.2.1" PrivateAssets="All" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class AuditLoqQueue : Feature
{
public AuditLoqQueue()
{
EnableByDefault();
Prerequisite(c =>
{
var settings = c.Settings.Get<Settings>("ServiceControl.Settings");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class ErrorLoqQueue : Feature
{
public ErrorLoqQueue()
{
EnableByDefault();
Prerequisite(c =>
{
var settings = c.Settings.Get<Settings>("ServiceControl.Settings");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public RawEndpointFactory(Settings settings, TransportSettings transportSettings
public RawEndpointConfiguration CreateRawEndpointConfiguration(string name, Func<MessageContext, IDispatchMessages, Task> onMessage, TransportDefinition transportDefinition)
{
var config = RawEndpointConfiguration.Create(name, onMessage, $"{transportSettings.EndpointName}.errors");
config.AutoCreateQueue();
config.LimitMessageProcessingConcurrencyTo(settings.MaximumConcurrencyLevel);

transportCustomization.CustomizeRawEndpoint(config, transportSettings);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace ServiceControl.Recoverability

public class ReturnToSenderDequeuer
{
public ReturnToSenderDequeuer(TransportDefinition transportDefinition, ReturnToSender returnToSender, IDocumentStore store, IDomainEvents domainEvents, string endpointName, RawEndpointFactory rawEndpointFactory)
public ReturnToSenderDequeuer(TransportDefinition transportDefinition, ReturnToSender returnToSender, IDocumentStore store, IDomainEvents domainEvents, string inputAddress, RawEndpointFactory rawEndpointFactory)
{
InputAddress = $"{endpointName}.staging";
InputAddress = inputAddress;
this.returnToSender = returnToSender;

createEndpointConfiguration = () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ public ReturnToSenderDequeuerFeature()

protected override void Setup(FeatureConfigurationContext context)
{
var inputAddress = $"{context.Settings.EndpointName()}.staging";

var queueBindings = context.Settings.Get<QueueBindings>();
queueBindings.BindReceiving(inputAddress);

context.Container.ConfigureComponent(
b => new ReturnToSenderDequeuer(
context.Settings.Get<TransportDefinition>(),
b.Build<ReturnToSender>(),
b.Build<IDocumentStore>(),
b.Build<IDomainEvents>(),
context.Settings.EndpointName(),
inputAddress,
b.Build<RawEndpointFactory>()),
DependencyLifecycle.SingleInstance);

Expand All @@ -38,7 +43,7 @@ public StartupTask(ReturnToSenderDequeuer returnToSenderDequeuer)

protected override Task OnStart(IMessageSession session)
{
return returnToSenderDequeuer.CreateQueue();
return Task.CompletedTask;
}

protected override Task OnStop(IMessageSession session)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public class InvokeServiceControlInstanceUpgrade : PSCmdlet
[Parameter(Mandatory = false, HelpMessage = "Do not automatically create new queues")]
public SwitchParameter SkipQueueCreation { get; set; }

[Parameter(HelpMessage = "Specify the database maintenance port number to listen on. If this is the only ServiceControl instance then 33334 is recommended")]
[ValidateRange(1, 49151)]
public int DatabaseMaintenancePort { get; set; }

protected override void BeginProcessing()
{
Expand All @@ -44,7 +47,8 @@ protected override void ProcessRecord()
AuditRetentionPeriod = AuditRetentionPeriod,
ErrorRetentionPeriod = ErrorRetentionPeriod,
OverrideEnableErrorForwarding = ForwardErrorMessages,
SkipQueueCreation = SkipQueueCreation
SkipQueueCreation = SkipQueueCreation,
MaintenancePort = DatabaseMaintenancePort == 0 ? (int?)null : DatabaseMaintenancePort
};
var instance = InstanceFinder.FindServiceControlInstance(name);
if (instance == null)
Expand Down Expand Up @@ -75,6 +79,11 @@ protected override void ProcessRecord()
ThrowTerminatingError(new ErrorRecord(new Exception($"Upgrade of {instance.Name} aborted. ForwardErrorMessages parameter must be set to true or false because the configuration file has no setting for ForwardErrorMessages. This setting is mandatory as of version 1.12"), "UpgradeFailure", ErrorCategory.InvalidArgument, null));
}

if (!options.MaintenancePort.HasValue & !instance.AppConfig.AppSettingExists(SettingsList.DatabaseMaintenancePort.Name))
{
ThrowTerminatingError(new ErrorRecord(new Exception($"Upgrade of {instance.Name} aborted. DatabaseMaintenancePort parameter must be set to a value between 1 and 49151 because the configuration file has no setting for DatabaseMaintenancePort. This setting is mandatory as of version 2.0.0. If this is the only instance of ServiceControl, 33334 is the recommended value."), "UpgradeFailure", ErrorCategory.InvalidArgument, null));
}

if (!options.ErrorRetentionPeriod.HasValue & !instance.AppConfig.AppSettingExists(SettingsList.ErrorRetentionPeriod.Name))
{
ThrowTerminatingError(new ErrorRecord(new Exception($"Upgrade of {instance.Name} aborted. ErrorRetentionPeriod parameter must be set to timespan because the configuration file has no setting for ErrorRetentionPeriod. This setting is mandatory as of version 1.13"), "UpgradeFailure", ErrorCategory.InvalidArgument, null));
Expand Down