/// <summary> /// Initializes a new instance of the <see cref="RabbitReceiver"/> class. /// </summary> /// <param name="bus">A reference to the bus containing the receiver</param> /// <param name="configuration"> /// The configuration. /// </param> /// <param name="connectionPool"> /// A bus connection pool /// </param> public RabbitReceiver(RabbitBus bus, IReceiverConfiguration configuration, IConnectionPool <IRabbitConnection> connectionPool) : base(configuration) { this.bus = bus; this.connectionPool = connectionPool; this.receiverOptions = (RabbitReceiverOptions)configuration.Options; this.logger = LogManager.GetLogger($"{this.GetType().FullName}(Endpoint=\"{this.bus.Endpoint}\")"); }
/// <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})"); }
/// <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}\")"); }
/// <summary> /// »нициализирует новый экземпл¤р класса <see cref="RabbitChannel"/>. /// </summary> /// <param name="bus"> /// The bus. /// </param> /// <param name="native"> /// The native. /// </param> public RabbitChannel(RabbitBus bus, IModel native) { this.bus = bus; this.Native = native; Logger.TraceFormat("Channel is opened."); this.Native.ModelShutdown += (model, reason) => { this.isClosed = true; Logger.TraceFormat("Channel is closed due to \"{0}\".", reason.ToString()); }; }
/// <summary> /// Инициализирует новый экземпляр класса <see cref="RabbitChannel"/>. /// </summary> /// <param name="bus"> /// The bus. /// </param> /// <param name="native"> /// The native. /// </param> public RabbitChannel(RabbitBus bus, IModel native) { this.bus = bus; this.Native = native; Logger.TraceFormat("Channel is opened."); this.Native.ModelShutdown += (model, reason) => { this.isClosed = true; Logger.TraceFormat("Channel is closed due to \"{0}\".", reason.ToString()); }; }
/// <summary> /// Инициализирует новый экземпляр класса <see cref="Producer"/>. /// </summary> /// <param name="bus"> /// Конечная точка, для которой создается отправитель. /// </param> /// <param name="label"> /// Метка сообщения, которая будет использоваться при отправлении сообщений. /// </param> /// <param name="routeResolver"> /// Определитель маршрутов, по которым можно отсылать и получать сообщения. /// </param> /// <param name="confirmationIsRequired"> /// Если <c>true</c> - тогда отправитель будет ожидать подтверждения о том, что сообщение было сохранено в брокере. /// </param> public Producer(RabbitBus bus, MessageLabel label, IRouteResolver routeResolver, bool confirmationIsRequired) { this.Channel = bus.OpenChannel(); this.Label = label; this.RouteResolver = routeResolver; this.ConfirmationIsRequired = confirmationIsRequired; if (this.ConfirmationIsRequired) { this.confirmationTracker = new DefaultPublishConfirmationTracker(this.Channel); this.Channel.EnablePublishConfirmation(); this.Channel.OnConfirmation(this.confirmationTracker.HandleConfirmation); } this.Failed += _ => ((IBusAdvanced)bus).Panic(); }
/// <summary> /// Инициализирует новый экземпляр класса <see cref="ListenerRegistry"/>. /// </summary> /// <param name="bus"> /// The bus. /// </param> public ListenerRegistry(RabbitBus bus) { this.bus = bus; }
/// <summary> /// Инициализирует новый экземпляр класса <see cref="ProducerRegistry"/>. /// </summary> /// <param name="bus"> /// The bus. /// </param> public ProducerRegistry(RabbitBus bus) { this._bus = bus; }
public RabbitCallbackReceiver(RabbitBus bus, IReceiverConfiguration configuration, IConnectionPool <IRabbitConnection> connectionPool) : base(bus, configuration, connectionPool) { }