|
@ -21,12 +21,12 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ |
|
|
public class EventBusRabbitMQ : IEventBus, IDisposable |
|
|
public class EventBusRabbitMQ : IEventBus, IDisposable |
|
|
{ |
|
|
{ |
|
|
const string BROKER_NAME = "eshop_event_bus"; |
|
|
const string BROKER_NAME = "eshop_event_bus"; |
|
|
|
|
|
const string AUTOFAC_SCOPE_NAME = "eshop_event_bus"; |
|
|
|
|
|
|
|
|
private readonly IRabbitMQPersistentConnection _persistentConnection; |
|
|
private readonly IRabbitMQPersistentConnection _persistentConnection; |
|
|
private readonly ILogger<EventBusRabbitMQ> _logger; |
|
|
private readonly ILogger<EventBusRabbitMQ> _logger; |
|
|
private readonly IEventBusSubscriptionsManager _subsManager; |
|
|
private readonly IEventBusSubscriptionsManager _subsManager; |
|
|
private readonly ILifetimeScope _autofac; |
|
|
private readonly ILifetimeScope _autofac; |
|
|
private readonly string AUTOFAC_SCOPE_NAME = "eshop_event_bus"; |
|
|
|
|
|
private readonly int _retryCount; |
|
|
private readonly int _retryCount; |
|
|
|
|
|
|
|
|
private IModel _consumerChannel; |
|
|
private IModel _consumerChannel; |
|
@ -86,7 +86,6 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ |
|
|
|
|
|
|
|
|
using (var channel = _persistentConnection.CreateModel()) |
|
|
using (var channel = _persistentConnection.CreateModel()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
_logger.LogTrace("Declaring RabbitMQ exchange to publish event: {EventId}", @event.Id); |
|
|
_logger.LogTrace("Declaring RabbitMQ exchange to publish event: {EventId}", @event.Id); |
|
|
|
|
|
|
|
|
channel.ExchangeDeclare(exchange: BROKER_NAME, type: "direct"); |
|
|
channel.ExchangeDeclare(exchange: BROKER_NAME, type: "direct"); |
|
|