Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RabbitSender"/> class.
        /// </summary>
        /// <param name="bus">
        /// A reference to the bus containing the sender
        /// </param>
        /// <param name="configuration">
        /// Конфигурация отправителя сообщений.
        /// </param>
        /// <param name="connectionPool">
        /// A bus connection pool
        /// </param>
        /// <param name="filters">
        /// Фильтры сообщений.
        /// </param>
        public RabbitSender(RabbitBus bus, ISenderConfiguration configuration, IConnectionPool <IRabbitConnection> connectionPool, IEnumerable <IMessageExchangeFilter> filters)
            : base(bus.Endpoint, configuration, filters)
        {
            this.bus            = bus;
            this.connectionPool = connectionPool;
            this.senderOptions  = (RabbitSenderOptions)this.Configuration.Options;

            this.logger = LogManager.GetLogger($"{this.GetType().FullName}(Endpoint=\"{this.bus.Endpoint}\")");
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RabbitSender"/> class.
        /// </summary>
        /// <param name="bus">
        /// A reference to the bus containing the sender
        /// </param>
        /// <param name="configuration">
        /// Конфигурация отправителя сообщений.
        /// </param>
        /// <param name="connectionPool">
        /// A bus connection pool
        /// </param>
        /// <param name="filters">
        /// Фильтры сообщений.
        /// </param>
        public RabbitSender(RabbitBus bus, ISenderConfiguration configuration, IConnectionPool <IRabbitConnection> connectionPool, IEnumerable <IMessageExchangeFilter> filters, IDictionary <Type, IMessageExchangeFilterDecorator> filterDecorators = null)
            : base(bus.Endpoint, configuration, filters, filterDecorators)
        {
            this.bus            = bus;
            this.connectionPool = connectionPool;
            this.senderOptions  = (RabbitSenderOptions)this.Configuration.Options;

            this.logger = LogManager.GetLogger($"{this.GetType().FullName}({this.bus.Endpoint}, {this.Configuration.Label})");
        }