Skip to content

Commit

Permalink
Merge pull request #884 from SkillsFundingAgency/CON-1828-NServiceBus…
Browse files Browse the repository at this point in the history
…-Error-Queue

Changed NServiceBus configuration
  • Loading branch information
narendranogothu authored Jun 4, 2020
2 parents da59ce1 + fb20d4f commit 2974e30
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NServiceBus;
using SFA.DAS.NServiceBus;
using SFA.DAS.NServiceBus.AzureServiceBus;
using SFA.DAS.NServiceBus.NewtonsoftJsonSerializer;
using SFA.DAS.NServiceBus.NLog;
using SFA.DAS.NServiceBus.Configuration;
using SFA.DAS.NServiceBus.Configuration.AzureServiceBus;
using SFA.DAS.NServiceBus.Configuration.NewtonsoftJsonSerializer;
using SFA.DAS.NServiceBus.Configuration.NLog;

namespace Esfa.Recruit.Vacancies.Jobs.NServiceBus
{
public static class ConfigureNServiceBus
{
private const string RecruitVacanciesJobs = "SFA.Recruit.Vacancies.Jobs";

public static void AddDasNServiceBus(this IServiceCollection services, IConfiguration configuration)
{
services
.AddSingleton(s =>
{
var hostingEnvironment = s.GetService<IHostingEnvironment>();

var serviceBusConfiguration = new DasSharedNServiceBusConfiguration();
configuration.GetSection(nameof(DasSharedNServiceBusConfiguration)).Bind(serviceBusConfiguration);

var endpointConfiguration = new EndpointConfiguration(RecruitVacanciesJobs)
.UseAzureServiceBusTransport(isDevelopment: false,
connectionStringBuilder: () => serviceBusConfiguration.ConnectionString,
routing: r => { })
.UseErrorQueue()
.UseAzureServiceBusTransport(serviceBusConfiguration.ConnectionString, r => { })
.UseErrorQueue($"{RecruitVacanciesJobs}-errors")
.UseInstallers()
.UseLicense(serviceBusConfiguration.NServiceBusLicense)
.UseMessageConventions()
Expand Down
6 changes: 2 additions & 4 deletions src/Jobs/Recruit.Vacancies.Jobs/Recruit.Vacancies.Jobs.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
Expand Down Expand Up @@ -34,10 +34,8 @@
<PackageReference Include="SFA.DAS.Notifications.Api.Types" Version="2.2.1" />
<PackageReference Include="SFA.DAS.ProviderRelationships.Messages" Version="3.2.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />
<PackageReference Include="SFA.DAS.NServiceBus" Version="10.0.1" />
<PackageReference Include="SFA.DAS.NServiceBus" Version="15.0.25" />
<PackageReference Include="SFA.DAS.EmployerAccounts.Messages" Version="1.6.2515" />
<PackageReference Include="NServiceBus" Version="7.1.10" />
<PackageReference Include="NServiceBus.MSDependencyInjection" Version="0.1.4" />
<PackageReference Include="Humanizer.Core.uk" Version="2.7.9" />

<ProjectReference Include="..\..\Communication\Communication.Core\Communication.Core.csproj" />
Expand Down

0 comments on commit 2974e30

Please sign in to comment.