Skip to content

Commit ee07549

Browse files
committed
HwProj/EventBus: .netstandard 2.0
1 parent f87504b commit ee07549

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

HwProj.EventBus/HwProj.EventBus.Client/HwProj.EventBus.Client.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFramework>netcoreapp2.2</TargetFramework>
5+
<TargetFramework>netstandard2.0</TargetFramework>
66
<ApplicationIcon />
77
<StartupObject />
88
<AssemblyName>HwProj.EventBus.Client</AssemblyName>
@@ -13,7 +13,7 @@
1313

1414
<ItemGroup>
1515
<PackageReference Include="Autofac" Version="6.0.0" />
16-
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.2.0" />
16+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1717
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.3" />
1818
<PackageReference Include="Polly.Extensions.Http" Version="3.0.0" />
1919
<PackageReference Include="RabbitMQ.Client" Version="5.1.2" />

HwProj.EventBus/HwProj.EventBus.Client/Implementations/EventBusRabbitMQ.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
using System;
22
using System.Collections.Generic;
3-
using System.Linq;
43
using System.Text;
54
using System.Threading.Tasks;
65
using HwProj.EventBus.Client.Interfaces;
7-
using Microsoft.AspNetCore.DataProtection;
6+
using Microsoft.Extensions.Configuration;
87
using Microsoft.Extensions.DependencyInjection;
98
using Newtonsoft.Json;
109
using Polly.Retry;
@@ -30,12 +29,11 @@ public class EventBusRabbitMq : IEventBus, IDisposable
3029
private readonly Dictionary<string, List<Type>> _handlers =
3130
new Dictionary<string, List<Type>>();
3231

33-
public EventBusRabbitMq(IDefaultConnection connection, IServiceProvider serviceProvider,
34-
IServiceScopeFactory scopeFactory, RetryPolicy policy)
32+
public EventBusRabbitMq(IDefaultConnection connection, IConfiguration configuration, IConnectionFactory connectionFactory, IServiceScopeFactory scopeFactory, RetryPolicy policy)
3533
{
3634
_connection = connection;
3735
_scopeFactory = scopeFactory;
38-
_queueName = serviceProvider.GetApplicationUniqueIdentifier().Split('\\').Last();
36+
_queueName = configuration.GetSection("EventBus")["EventBusQueueName"];
3937
_policy = policy;
4038
_consumerChannel = CreateConsumerChannel();
4139
}

0 commit comments

Comments
 (0)