upgrade-package: 升级RabbitMq依赖包2.0.9=>2.1.3

update:调整AddRabbitBoot中的初始化相关配置
This commit is contained in:
云龙 王 2024-11-20 11:22:16 +08:00
parent 96457adabe
commit 24859d393b
4 changed files with 15 additions and 17 deletions

View File

@ -26,9 +26,12 @@ public class TrackPushCompletedEventHandler : ITransientDependency, IRabbitHandl
_trackPushRecordEsRepository = trackPushRecordEsRepository;
}
public bool Enable(ConsumeOptions options)
public ConsumeOptions Options()
{
return options.Queue == GlobalConst.TrackPushCompletedSubscribe;
return new ConsumeOptions()
{
Queue = GlobalConst.TrackPushCompletedSubscribe
};
}
public async Task Handle(IServiceProvider sp, BasicDeliverEventArgs args, ConsumeOptions options)

View File

@ -39,10 +39,12 @@ public class TrackRefreshEventHandler : ITransientDependency, IRabbitHandler
_logger = logger;
}
public bool Enable(ConsumeOptions options)
public ConsumeOptions Options()
{
return options.Queue == GlobalConst.TrackRefreshSubscribe;
return new ConsumeOptions()
{
Queue = GlobalConst.TrackRefreshSubscribe,
};
}
public async Task Handle(IServiceProvider sp, BasicDeliverEventArgs args, ConsumeOptions options)

View File

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BSI.Stack.Rabbit" Version="2.0.9" />
<PackageReference Include="BSI.Stack.Rabbit" Version="2.1.3" />
<PackageReference Include="Savorboard.CAP.InMemoryMessageQueue" Version="8.2.1"/>
<PackageReference Include="SJZY.Expand.AliyunOSS" Version="7.0.17" />
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.2.3"/>

View File

@ -140,6 +140,10 @@ public class SjzyTrackApplicationModule : AbpModule
options.ConnectionString =
$"amqp://{configuration["RabbitMQ:UserName"]}:{configuration["RabbitMQ:Password"]}@{configuration["RabbitMQ:HostName"]}:{configuration["RabbitMQ:Port"]}";
options.PoolSize = configuration.GetValue<int>("RabbitMQ:PoolSize");
options.Declarations = new List<Action<IDeclaration>>()
{
o=>o.ExchangeDeclare(GlobalConst.TrackChangeExchange, ExchangeType.Topic, true),
};
options.Consumes = new List<ConsumeOptions>
{
new()
@ -154,17 +158,6 @@ public class SjzyTrackApplicationModule : AbpModule
o.QueueBind(GlobalConst.TrackRefreshSubscribe, GlobalConst.InterfaceRelayExchange,
GlobalConst.TrackRefreshSubscribe);
}
},
new()
{
//广播轨迹
Queue = GlobalConst.TrackRefreshSubscribe,
FetchCount = configuration.GetValue<ushort>("TrackApp:TrackRefreshFetchCount"),
FailedRequeue = false,
Declaration = o =>
{
o.ExchangeDeclare(GlobalConst.TrackChangeExchange, ExchangeType.Topic, true);
}
}
};
}, typeof(SjzyTrackApplicationModule).Assembly);