Inheritance: MessageBus.Binding.RabbitMQ.RabbitMQOutputChannelBase
        protected override T OnCreateChannel(EndpointAddress address, Uri via)
        {
            IChannel channel;

            if (typeof(T) == typeof(IOutputChannel))
            {
                channel = new RabbitMQTransportOutputChannel(_context, address, via);
            }
            else
            {
                return(default(T));
            }

            return((T)channel);
        }
Exemplo n.º 2
0
        public void TestInitialize()
        {
            _ev = new ManualResetEvent(false);

            const string clientAddress = "amqp://localhost/amq.direct?routingKey=NoSuchRoute";

            _binding = new RabbitMQBinding
                {
                    OneWayOnly = true,
                    ApplicationId = "MyApp",
                    Mandatory = true
                };

            _channelFactory = _binding.BuildChannelFactory<IOutputChannel>(this);

            _channelFactory.Open();

            _outputChannel = _channelFactory.CreateChannel(new EndpointAddress(clientAddress)) as RabbitMQTransportOutputChannel;

            _outputChannel.Open();
        }