Esempio n. 1
0
        /// <summary>
        /// Creates the broker.
        /// </summary>
        /// <param name="ctx">The context.</param>
        /// <param name="channel">The channel.</param>
        /// <param name="appId">The application ID.</param>
        internal Broker(BrokerContext ctx, IModel channel, string appId)
        {
            _ctx                  = ctx;
            _appId                = appId;
            _channel              = channel;
            _channel.BasicReturn += delegate(object s, RabbitMQ.Client.Events.BasicReturnEventArgs e) {
                OnReturned(new BrokerReturnedEventArgs(e.BasicProperties, e.Body, e.ReplyText));
            };
            _channel.ModelShutdown += delegate(object s, ShutdownEventArgs e) {
                // dispose
                Dispose();

                // call event
                OnShutdown(new BrokerShutdownEventArgs(e.ReplyText));
            };
        }