Skip to content

Commit 84d195f

Browse files
committed
refine
1 parent e7b2664 commit 84d195f

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

最后大项目代码/YouZack-VNext/Zack.Commons/Zack.Commons.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<PackageProjectUrl>https://github.com/yangzhongke/NETBookMaterials</PackageProjectUrl>
99
<RepositoryUrl>https://github.com/yangzhongke/NETBookMaterials</RepositoryUrl>
1010
<Version>1.1.10</Version>
11+
<LangVersion>10.0</LangVersion>
1112
</PropertyGroup>
1213

1314
<ItemGroup>

最后大项目代码/YouZack-VNext/Zack.EventBus/IntegrationEventRabbitMQOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class IntegrationEventRabbitMQOptions
44
{
55
public string HostName { get; set; }
66
public string ExchangeName { get; set; }
7-
public string UserName { get; set; }
8-
public string Password { get; set; }
7+
public string? UserName { get; set; }
8+
public string? Password { get; set; }
99
}
1010
}

最后大项目代码/YouZack-VNext/Zack.EventBus/ServicesCollectionExtensions.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,17 @@ public static IServiceCollection AddEventBus(this IServiceCollection services, s
5353
var factory = new ConnectionFactory()
5454
{
5555
HostName = optionMQ.HostName,
56-
UserName=optionMQ.UserName,
57-
Password=optionMQ.Password,
56+
5857
DispatchConsumersAsync = true
5958
};
59+
if(optionMQ.UserName!=null)
60+
{
61+
factory.UserName = optionMQ.UserName;
62+
}
63+
if (optionMQ.Password != null)
64+
{
65+
factory.Password = optionMQ.Password;
66+
}
6067
//eventBus归DI管理,释放的时候会调用Dispose
6168
//eventbus的Dispose中会销毁RabbitMQConnection
6269
RabbitMQConnection mqConnection = new RabbitMQConnection(factory);

最后大项目代码/YouZack-VNext/Zack.EventBus/Zack.EventBus.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Authors>Zack Yang</Authors>
88
<PackageProjectUrl>https://github.com/yangzhongke/NETBookMaterials</PackageProjectUrl>
99
<RepositoryUrl>https://github.com/yangzhongke/NETBookMaterials</RepositoryUrl>
10-
<Version>1.1.2</Version>
10+
<Version>1.1.3</Version>
1111
</PropertyGroup>
1212

1313
<ItemGroup>

0 commit comments

Comments
 (0)