Beispiel #1
0
        /// <summary>
        /// Consumes the message on a SelectiveConsumerChannel given the specified delegate
        /// </summary>
        /// <param name="configurator"></param>
        /// <param name="selectiveConsumer"></param>
        /// <returns></returns>
        public static ConsumerConfigurator <TChannel> UsingSelectiveConsumer <TChannel>(
            this ChannelConfigurator <TChannel> configurator, SelectiveConsumer <TChannel> selectiveConsumer)
        {
            var consumerConfigurator = new SelectiveConsumerConfigurator <TChannel>(selectiveConsumer);

            configurator.AddConfigurator(consumerConfigurator);

            return(consumerConfigurator);
        }
Beispiel #2
0
        /// <summary>
        /// Add a consumer to the channel using the message type defined for the channel
        /// </summary>
        /// <typeparam name="TChannel">The channel type, specifies the type of message sent by the channel</typeparam>
        /// <param name="connectionConfigurator">The connection configurator</param>
        /// <param name="consumer">The consumer to add to the channel</param>
        /// <returns>A consumer configurator to customize the consumer settings</returns>
        public static ConsumerConfigurator <TChannel> AddSelectiveConsumer <TChannel>(
            this ConnectionConfigurator <TChannel> connectionConfigurator,
            SelectiveConsumer <TChannel> consumer)
        {
            var channelConfigurator = new ChannelConfiguratorImpl <TChannel>();

            connectionConfigurator.AddConfigurator(channelConfigurator);

            var consumerConfigurator = new SelectiveConsumerConfigurator <TChannel>(consumer);

            channelConfigurator.AddConfigurator(consumerConfigurator);

            return(consumerConfigurator);
        }