예제 #1
0
        /// <summary>
        /// Creates the input channel.
        /// </summary>
        /// <param name="subscription">An RmqSubscription with parameters to create the queue with</param>
        /// <returns>IAmAnInputChannel.</returns>
        public IAmAChannel CreateChannel(Subscription subscription)
        {
            RmqSubscription rmqSubscription = subscription as RmqSubscription;

            if (rmqSubscription == null)
            {
                throw new ConfigurationException("We expect an RmqSubscription or RmqSubscription<T> as a parameter");
            }

            var messageConsumer = _messageConsumerFactory.Create(rmqSubscription);

            return(new Channel(
                       channelName: subscription.ChannelName,
                       messageConsumer: messageConsumer,
                       maxQueueLength: subscription.BufferSize
                       ));
        }
예제 #2
0
 /// <summary>
 /// Creates the input channel.
 /// </summary>
 /// <param name="connection">The connection parameters to create the queue with</param>
 /// <returns>IAmAnInputChannel.</returns>
 public IAmAChannel CreateInputChannel(Connection connection)
 {
     return(new Channel(connection.ChannelName, _messageConsumerFactory.Create(connection)));
 }
예제 #3
0
 /// <summary>
 /// Creates the input channel.
 /// </summary>
 /// <param name="connection">The connection parameters to create the queue with</param>
 /// <returns>IAmAnInputChannel.</returns>
 public IAmAChannel CreateChannel(Connection connection)
 {
     return(new Channel(connection.ChannelName,
                        _messageConsumerFactory.Create(connection),
                        connection.BufferSize));
 }
예제 #4
0
 /// <summary>
 /// Creates the input channel.
 /// </summary>
 /// <param name="channelName">Name of the channel.</param>
 /// <param name="routingKey">The routing key.</param>
 /// <param name="isDurable">Is the queue definition persisted</param>
 /// <param name="highAvailability">Is the queue available on all nodes in a cluster</param>
 /// <returns>IAmAnInputChannel.</returns>
 public IAmAChannel CreateInputChannel(string channelName, string routingKey, bool isDurable = false, bool highAvailability = false)
 {
     return(new Channel(channelName, _messageConsumerFactory.Create(channelName, routingKey, isDurable, highAvailability)));
 }