Example #1
0
 /// <summary>
 /// Creates a new RabbitMQ Event bus.
 /// </summary>
 /// <param name="serializer">Object serializer.</param>
 /// <param name="configuration">Configuration to use for using RabbitMQ</param>
 /// <param name="loggerFactory">LoggerFactory</param>
 public RabbitMQEventBus(
     IDispatcherSerializer serializer,
     RabbitPublisherBusConfiguration configuration,
     ILoggerFactory?loggerFactory = null)
 {
     _logger        = (loggerFactory ?? new LoggerFactory(new[] { new DebugLoggerProvider() })).CreateLogger <RabbitMQEventBus>();
     _configuration = configuration ?? RabbitPublisherBusConfiguration.Default;
     _serializer    = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
Example #2
0
 /// <summary>
 /// Creates a new RabbitMQ Event bus.
 /// </summary>
 /// <param name="serializer">Object serializer.</param>
 /// <param name="configuration">Configuration to use for using RabbitMQ</param>
 /// <param name="loggerFactory">LoggerFactory</param>
 public RabbitMQEventBus(
     IDispatcherSerializer serializer,
     RabbitPublisherBusConfiguration configuration,
     ILoggerFactory loggerFactory = null)
 {
     if (loggerFactory == null)
     {
         loggerFactory = new LoggerFactory();
         loggerFactory.AddProvider(new DebugLoggerProvider());
     }
     _logger        = loggerFactory.CreateLogger <RabbitMQEventBus>();
     _configuration = configuration ?? RabbitPublisherBusConfiguration.Default;
     _serializer    = serializer ?? throw new System.ArgumentNullException(nameof(serializer));
 }