Skip to content

Commit

Permalink
Merge pull request #688 from SkillsFundingAgency/CV-650-with-arm-upda…
Browse files Browse the repository at this point in the history
…te-v2-only

CV-650 added NSB 16.x to V2 codebase only
  • Loading branch information
Najamuddin-Muhammad authored Mar 6, 2020
2 parents d6cb5f4 + 189142c commit e8ed5be
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace SFA.DAS.CommitmentsV2.Api.NServiceBus
{
public static class ServiceCollectionExtensions
{
private const string EndpointName = "SFA.DAS.CommitmentsV2.Api";

public static IServiceCollection AddNServiceBus(this IServiceCollection services)
{
return services
Expand All @@ -28,8 +30,8 @@ public static IServiceCollection AddNServiceBus(this IServiceCollection services
var configuration = p.GetService<CommitmentsV2Configuration>().NServiceBusConfiguration;
var runInDevelopmentMode = hostingEnvironment.IsDevelopment() || hostingEnvironment.EnvironmentName == Domain.Constants.IntegrationTestEnvironment;

var endpointConfiguration = new EndpointConfiguration("SFA.DAS.CommitmentsV2.Api")
.UseErrorQueue()
var endpointConfiguration = new EndpointConfiguration(EndpointName)
.UseErrorQueue($"{EndpointName}-errors")
.UseInstallers()
.UseLicense(configuration.NServiceBusLicense)
.UseMessageConventions()
Expand All @@ -46,7 +48,7 @@ public static IServiceCollection AddNServiceBus(this IServiceCollection services
}
else
{
endpointConfiguration.UseAzureServiceBusTransport(configuration.ServiceBusConnectionString, s => s.AddRouting());
endpointConfiguration.UseAzureServiceBusTransport(configuration.SharedServiceBusEndpointUrl, s => s.AddRouting());
}

var endpoint = Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace SFA.DAS.CommitmentsV2.Jobs.NServiceBus
{
public static class ServiceCollectionExtensions
{
private const string EndpointName = "SFA.DAS.CommitmentsV2.Jobs";

public static IServiceCollection AddNServiceBus(this IServiceCollection services)
{
return services
Expand All @@ -27,8 +29,8 @@ public static IServiceCollection AddNServiceBus(this IServiceCollection services
var configuration = p.GetService<CommitmentsV2Configuration>().NServiceBusConfiguration;
var isDevelopment = hostingEnvironment.IsDevelopment();

var endpointConfiguration = new EndpointConfiguration("SFA.DAS.CommitmentsV2.Jobs")
.UseErrorQueue()
var endpointConfiguration = new EndpointConfiguration(EndpointName)
.UseErrorQueue($"{EndpointName}-errors")
.UseInstallers()
.UseLicense(configuration.NServiceBusLicense)
.UseMessageConventions()
Expand All @@ -44,7 +46,7 @@ public static IServiceCollection AddNServiceBus(this IServiceCollection services
}
else
{
endpointConfiguration.UseAzureServiceBusTransport(configuration.ServiceBusConnectionString,s => s.AddRouting());
endpointConfiguration.UseAzureServiceBusTransport(configuration.SharedServiceBusEndpointUrl, s => s.AddRouting());
}

var endpoint = Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ namespace SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness
{
internal class Program
{
private const string EndpointName = "SFA.DAS.CommitmentsV2.TestHarness";

public static async Task Main()
{
var builder = new ConfigurationBuilder()
Expand All @@ -31,8 +33,8 @@ public static async Task Main()
var config = provider.GetService<IOptions<CommitmentsV2Configuration>>().Value.NServiceBusConfiguration;
var isDevelopment = Environment.GetEnvironmentVariable(EnvironmentVariableNames.EnvironmentName) == "LOCAL";

var endpointConfiguration = new EndpointConfiguration("SFA.DAS.CommitmentsV2.MessageHandlers.TestHarness")
.UseErrorQueue()
var endpointConfiguration = new EndpointConfiguration(EndpointName)
.UseErrorQueue($"{EndpointName}-errors")
.UseInstallers()
.UseMessageConventions()
.UseNewtonsoftJsonSerializer();
Expand All @@ -43,7 +45,7 @@ public static async Task Main()
}
else
{
endpointConfiguration.UseAzureServiceBusTransport(config.ServiceBusConnectionString, s => s.AddRouting());
endpointConfiguration.UseAzureServiceBusTransport(config.SharedServiceBusEndpointUrl, s => s.AddRouting());
}

var endpoint = await Endpoint.Start(endpointConfiguration);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ namespace SFA.DAS.CommitmentsV2.MessageHandlers.NServiceBus
{
public static class ServiceCollectionExtensions
{
private const string EndpointName = "SFA.DAS.CommitmentsV2.MessageHandlers";

public static IServiceCollection AddNServiceBus(this IServiceCollection services)
{
return services
Expand All @@ -28,7 +30,8 @@ public static IServiceCollection AddNServiceBus(this IServiceCollection services
var configuration = p.GetService<CommitmentsV2Configuration>().NServiceBusConfiguration;
var isDevelopment = hostingEnvironment.IsDevelopment();

var endpointConfiguration = new EndpointConfiguration("SFA.DAS.CommitmentsV2.MessageHandlers")
var endpointConfiguration = new EndpointConfiguration(EndpointName)
.UseErrorQueue($"{EndpointName}-errors")
.UseInstallers()
.UseLicense(configuration.NServiceBusLicense)
.UseMessageConventions()
Expand All @@ -45,7 +48,7 @@ public static IServiceCollection AddNServiceBus(this IServiceCollection services
}
else
{
endpointConfiguration.UseAzureServiceBusTransport(configuration.ServiceBusConnectionString,s => s.AddRouting());
endpointConfiguration.UseAzureServiceBusTransport(configuration.SharedServiceBusEndpointUrl,s => s.AddRouting());
}

var endpoint = Endpoint.Start(endpointConfiguration).GetAwaiter().GetResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="CommandLineParser" Version="2.4.3" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
<PackageReference Include="NServiceBus.Newtonsoft.Json" Version="2.1.0" />
<PackageReference Include="SFA.DAS.NServiceBus" Version="15.0.8" />
<PackageReference Include="SFA.DAS.NServiceBus" Version="16.0.2" />
<PackageReference Include="StructureMap" Version="4.7.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class NServiceBusConfiguration
{
public string ServiceBusConnectionString { get; set; }

public string SharedServiceBusEndpointUrl { get; set; }
public string NServiceBusLicense
{
get => _decodedNServiceBusLicense ??
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PackageReference Include="SFA.DAS.Encoding" Version="1.1.57" />
<PackageReference Include="SFA.DAS.Learners" Version="1.1.181" />
<PackageReference Include="SFA.DAS.Notifications.Messages" Version="3.0.0" />
<PackageReference Include="SFA.DAS.NServiceBus" Version="15.0.8" />
<PackageReference Include="SFA.DAS.NServiceBus" Version="16.0.2" />
<PackageReference Include="SFA.DAS.NServiceBus.SqlServer" Version="15.0.8" />
<PackageReference Include="SFA.DAS.Providers.Api.Client" Version="0.11.233" />
<PackageReference Include="SFA.DAS.UnitOfWork" Version="9.0.8" />
Expand Down

0 comments on commit e8ed5be

Please sign in to comment.