Exemple #1
0
        public static IInputChannel CreateReaderChannel(string queueName)
        {
            lock (typeof(QueueChannelFactory))
            {
                if (brokerBinding == null)
                {
                    InitializeBinding();
                }

                if (readerFactory == null)
                {
                    readerFactory = brokerBinding.BuildChannelFactory <IInputChannel>(bindingParameters);
                    readerFactory.Open();
                }

                IInputChannel channel = readerFactory.CreateChannel(new EndpointAddress(
                                                                        new Uri("amqp:" + queueName)));
                channel.Open();

                return(channel);
            }
        }