Ejemplo n.º 1
0
        public RabbitAdvancedPublishChannel(RabbitAdvancedBus advancedBus)
        {
            if (advancedBus == null)
            {
                throw new ArgumentNullException("advancedBus");
            }
            if (!advancedBus.Connection.IsConnected)
            {
                throw new EasyNetQException("Cannot open channel for publishing, the broker is not connected");
            }

            this.advancedBus = advancedBus;
            channel          = advancedBus.Connection.CreateModel();
        }
Ejemplo n.º 2
0
        public RabbitAdvancedPublishChannel(RabbitAdvancedBus advancedBus, Action <IChannelConfiguration> configure)
        {
            Preconditions.CheckNotNull(advancedBus, "advancedBus");

            if (!advancedBus.Connection.IsConnected)
            {
                throw new EasyNetQException("Cannot open channel for publishing, the broker is not connected");
            }

            this.advancedBus = advancedBus;
            channel          = advancedBus.Connection.CreateModel();

            channelConfiguration = new ChannelConfiguration();
            configure(channelConfiguration);

            publisherConfirms = ConfigureChannel(channelConfiguration, channel);
        }