Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MyContext : ScenarioContext;

public class EndpointWithFailingCustomCheck : EndpointConfigurationBuilder
{
public EndpointWithFailingCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromSeconds(1)); });
public EndpointWithFailingCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1)); });

class FailingCustomCheck() : CustomCheck("MyCustomCheckId", "MyCategory")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected override async Task OnStart(IMessageSession session, CancellationToken

public class WithCustomCheck : EndpointConfigurationBuilder
{
public WithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromSeconds(1)); });
public WithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1)); });

class FailingCustomCheck(MyContext context)
: NServiceBus.CustomChecks.CustomCheck("MyCustomCheckId", "MyCategory", TimeSpan.FromSeconds(5))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class Sender : EndpointConfigurationBuilder
public Sender() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
c.ReportCustomChecksTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromSeconds(1));
c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1));
c.NoRetries();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class MyContext : ScenarioContext

public class EndpointWithCustomCheck : EndpointConfigurationBuilder
{
public EndpointWithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => c.ReportCustomChecksTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromSeconds(1)));
public EndpointWithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1)));

public class EventuallyFailingCustomCheck()
: CustomCheck("EventuallyFailingCustomCheck", "Testing", TimeSpan.FromSeconds(1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class MyContext : ScenarioContext

public class EndpointWithFailingCustomCheck : EndpointConfigurationBuilder
{
public EndpointWithFailingCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromSeconds(1)); });
public EndpointWithFailingCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1)); });

class FailingCustomCheck() : CustomCheck("MyCustomCheckId", "MyCategory")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected override Task OnStart(IMessageSession session, CancellationToken cance

class EndpointWithCustomCheck : EndpointConfigurationBuilder
{
public EndpointWithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromSeconds(1)); });
public EndpointWithCustomCheck() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.ReportCustomChecksTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromSeconds(1)); });

public class EventuallyFailingCustomCheck()
: CustomCheck("EventuallyFailingCustomCheck", "Testing", TimeSpan.FromSeconds(1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_SERVICE_NAME);
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata =>
{
publisherMetadata.RegisterPublisherFor<CustomCheckFailed>(Settings.DEFAULT_SERVICE_NAME);
publisherMetadata.RegisterPublisherFor<CustomCheckFailed>(Settings.DEFAULT_INSTANCE_NAME);
});

public class CustomCheckFailedHandler(MyContext testContext) : IHandleMessages<CustomCheckFailed>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_SERVICE_NAME);
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata =>
{
publisherMetadata.RegisterPublisherFor<CustomCheckSucceeded>(Settings.DEFAULT_SERVICE_NAME);
publisherMetadata.RegisterPublisherFor<CustomCheckSucceeded>(Settings.DEFAULT_INSTANCE_NAME);
});

public class CustomCheckSucceededHandler(MyContext testContext) : IHandleMessages<CustomCheckSucceeded>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<HeartbeatRestored>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<HeartbeatRestored>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(MyContext testContext) : IHandleMessages<HeartbeatRestored>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<HeartbeatStopped>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<HeartbeatStopped>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(MyContext testContext) : IHandleMessages<HeartbeatStopped>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Context : ScenarioContext;

public class StartingEndpoint : EndpointConfigurationBuilder
{
public StartingEndpoint() => EndpointSetup<DefaultServerWithoutAudit>(c => c.SendHeartbeatTo(Settings.DEFAULT_SERVICE_NAME, TimeSpan.FromHours(1)));
public StartingEndpoint() => EndpointSetup<DefaultServerWithoutAudit>(c => c.SendHeartbeatTo(Settings.DEFAULT_INSTANCE_NAME, TimeSpan.FromHours(1)));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class StartingEndpoint : EndpointConfigurationBuilder
public StartingEndpoint() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
c.SendHeartbeatTo(Settings.DEFAULT_SERVICE_NAME);
c.SendHeartbeatTo(Settings.DEFAULT_INSTANCE_NAME);

c.GetSettings().Set("ServiceControl.CustomHostIdentifier", hostIdentifier);
c.UniquelyIdentifyRunningInstance().UsingCustomIdentifier(hostIdentifier);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class MyContext : ScenarioContext;

public class StartingEndpoint : EndpointConfigurationBuilder
{
public StartingEndpoint() => EndpointSetup<DefaultServerWithoutAudit>(c => c.SendHeartbeatTo(Settings.DEFAULT_SERVICE_NAME));
public StartingEndpoint() => EndpointSetup<DefaultServerWithoutAudit>(c => c.SendHeartbeatTo(Settings.DEFAULT_INSTANCE_NAME));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ await Define<MyContext>()
var options = new SendOptions();

options.DoNotEnforceBestPractices();
options.SetDestination(Settings.DEFAULT_SERVICE_NAME);
options.SetDestination(Settings.DEFAULT_INSTANCE_NAME);

return bus.Send(new NewEndpointDetected
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ await Define<MyContext>()
var options = new SendOptions();

options.DoNotEnforceBestPractices();
options.SetDestination(Settings.DEFAULT_SERVICE_NAME);
options.SetDestination(Settings.DEFAULT_INSTANCE_NAME);

return bus.Send(new NewEndpointDetected
{
Expand Down Expand Up @@ -81,7 +81,7 @@ public class WithoutHeartbeat : EndpointConfigurationBuilder

public class WithHeartbeat : EndpointConfigurationBuilder
{
public WithHeartbeat() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.SendHeartbeatTo(Settings.DEFAULT_SERVICE_NAME); }).CustomEndpointName(EndpointName);
public WithHeartbeat() => EndpointSetup<DefaultServerWithoutAudit>(c => { c.SendHeartbeatTo(Settings.DEFAULT_INSTANCE_NAME); }).CustomEndpointName(EndpointName);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(FailedMessagesArchived).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesArchived>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(FailedMessagesArchived).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesArchived>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(Context testContext) : IHandleMessages<FailedMessagesArchived>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(FailedMessagesArchived).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesArchived>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(FailedMessagesArchived).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesArchived>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(Context testContext) : IHandleMessages<MessageFailureResolvedByRetry>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailureResolvedManually).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<MessageFailureResolvedManually>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(MessageFailureResolvedManually).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<MessageFailureResolvedManually>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(Context testContext) : IHandleMessages<MessageFailureResolvedManually>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ public ExternalProcessor()
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(FailedMessagesUnArchived).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesUnArchived>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(FailedMessagesUnArchived).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesUnArchived>(Settings.DEFAULT_INSTANCE_NAME); });
}

public class FailureHandler(Context testContext) : IHandleMessages<FailedMessagesUnArchived>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(FailedMessagesArchived).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesArchived>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(FailedMessagesArchived).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<FailedMessagesArchived>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(Context testContext) : IHandleMessages<FailedMessagesArchived>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<MessageFailed>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<MessageFailed>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(MyContext testContext) : IHandleMessages<MessageFailed>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ public ExternalProcessor() =>
EndpointSetup<DefaultServerWithoutAudit>(c =>
{
var routing = c.ConfigureRouting();
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_SERVICE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<HeartbeatStopped>(Settings.DEFAULT_SERVICE_NAME); });
routing.RouteToEndpoint(typeof(MessageFailed).Assembly, Settings.DEFAULT_INSTANCE_NAME);
}, publisherMetadata => { publisherMetadata.RegisterPublisherFor<HeartbeatStopped>(Settings.DEFAULT_INSTANCE_NAME); });

public class FailureHandler(MyContext testContext) : IHandleMessages<HeartbeatStopped>
{
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceControl.AcceptanceTests/RootControllerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public async Task Should_gather_remote_data()
new RemoteInstanceSetting(settings.RootUrl),
new RemoteInstanceSetting(settings.RootUrl)
];
serviceName = settings.ServiceName;
serviceName = settings.InstanceName;
baseAddress = settings.RootUrl;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task Teardown()
}

#pragma warning disable IDE0060 // Remove unused parameter
protected void ExecuteWhen(Func<bool> execute, Func<IDomainEvents, Task> action, string instanceName = Settings.DEFAULT_SERVICE_NAME)
protected void ExecuteWhen(Func<bool> execute, Func<IDomainEvents, Task> action, string instanceName = Settings.DEFAULT_INSTANCE_NAME)
#pragma warning restore IDE0060 // Remove unused parameter
{
var timeout = TimeSpan.FromSeconds(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public async Task Invoke(IIncomingPhysicalMessageContext context, Func<IIncoming
if (context.MessageHeaders.TryGetValue("ServiceControl.Retry.UniqueMessageId", out var messageId))
{
var options = new SendOptions();
options.SetDestination(Settings.DEFAULT_SERVICE_NAME);
options.SetDestination(Settings.DEFAULT_INSTANCE_NAME);

await context.Send(new MarkMessageFailureResolvedByRetry
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ async Task InitializeServiceControl(ScenarioContext context)
Directory.CreateDirectory(logPath);
var loggingSettings = new LoggingSettings(Settings.SettingsRootNamespace, defaultLevel: LogLevel.Debug, logPath: logPath);

var settings = new Settings(instanceName, transportToUse.TypeName, persistenceToUse.PersistenceType, loggingSettings, forwardErrorMessages: false, errorRetentionPeriod: TimeSpan.FromDays(10))
var settings = new Settings(transportToUse.TypeName, persistenceToUse.PersistenceType, loggingSettings, forwardErrorMessages: false, errorRetentionPeriod: TimeSpan.FromDays(10))
{
InstanceName = instanceName,
AllowMessageEditing = true,
ForwardErrorMessages = false,
TransportConnectionString = transportToUse.ConnectionString,
Expand Down Expand Up @@ -151,6 +152,6 @@ public override async Task Stop(CancellationToken cancellationToken = default)
readonly Action<Settings> setSettings;
readonly Action<EndpointConfiguration> customConfiguration;
readonly Action<IHostApplicationBuilder> hostBuilderCustomization;
readonly string instanceName = Settings.DEFAULT_SERVICE_NAME;
readonly string instanceName = Settings.DEFAULT_INSTANCE_NAME;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ async Task InitializeServiceControl(ScenarioContext context)

var loggingSettings = new LoggingSettings(Settings.SettingsRootNamespace, defaultLevel: NLog.LogLevel.Debug, logPath: logPath);

settings = new Settings(instanceName, transportToUse.TypeName, persistenceToUse.PersistenceType, loggingSettings)
settings = new Settings(transportToUse.TypeName, persistenceToUse.PersistenceType, loggingSettings)
{
InstanceName = instanceName,
TransportConnectionString = transportToUse.ConnectionString,
MaximumConcurrencyLevel = 2,
ServiceControlQueueAddress = "SHOULDNOTBEUSED",
Expand Down Expand Up @@ -118,9 +119,9 @@ async Task InitializeServiceControl(ScenarioContext context)
{
var logitem = new ScenarioContext.LogItem
{
Endpoint = settings.ServiceName,
Endpoint = settings.InstanceName,
Level = NServiceBus.Logging.LogLevel.Fatal,
LoggerName = $"{settings.ServiceName}.CriticalError",
LoggerName = $"{settings.InstanceName}.CriticalError",
Message = $"{criticalErrorContext.Error}{Environment.NewLine}{criticalErrorContext.Exception}"
};
context.Logs.Enqueue(logitem);
Expand Down Expand Up @@ -152,7 +153,7 @@ public override async Task Stop(CancellationToken cancellationToken = default)
}
}

string instanceName = Settings.DEFAULT_SERVICE_NAME;
string instanceName = Settings.DEFAULT_INSTANCE_NAME;
WebApplication host;
Settings settings;
}
Expand Down
Loading