Browse Source

Merge pull request #17238 from abpframework/liangshiwei/rabbitmq

Use one-off channels for passive declarations
pull/17240/head
maliming 3 years ago
committed by GitHub
parent
commit
3775c7d7aa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs

5
framework/src/Volo.Abp.EventBus.RabbitMQ/Volo/Abp/EventBus/RabbitMq/RabbitMqDistributedEventBus.cs

@ -330,7 +330,10 @@ public class RabbitMqDistributedEventBus : DistributedEventBusBase, ISingletonDe
try
{
channel.ExchangeDeclarePassive(AbpRabbitMqEventBusOptions.ExchangeName);
using (var temporaryChannel = ConnectionPool.Get(AbpRabbitMqEventBusOptions.ConnectionName).CreateModel())
{
temporaryChannel.ExchangeDeclarePassive(AbpRabbitMqEventBusOptions.ExchangeName);
}
}
catch (Exception)
{

Loading…
Cancel
Save