Browse Source

Use one-off channels for passive declarations

pull/17238/head
liangshiwei 3 years ago
parent
commit
6ba8a1a6b2
  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 try
{ {
channel.ExchangeDeclarePassive(AbpRabbitMqEventBusOptions.ExchangeName); using (var temporaryChannel = ConnectionPool.Get(AbpRabbitMqEventBusOptions.ConnectionName).CreateModel())
{
temporaryChannel.ExchangeDeclarePassive(AbpRabbitMqEventBusOptions.ExchangeName);
}
} }
catch (Exception) catch (Exception)
{ {

Loading…
Cancel
Save