public void EndpointSendAndReceive()
        {
            using (var management = new RabbitMqEndpointManagement(_queue))
            {
                management.BindQueue(_queue.Name, _exchange.Name, ExchangeType.Fanout, "", null);
            }

            IMessageSerializer serializer = new XmlMessageSerializer();

            var message = new BugsBunny {Food = "Carrot"};

            IDuplexTransport transport = _factory.BuildLoopback(new TransportSettings(_exchange));
            IOutboundTransport error = _factory.BuildError(new TransportSettings(_error));

            var sendEndpoint = new Endpoint(_exchange, serializer, transport, error,
                new InMemoryInboundMessageTracker(5));
            sendEndpoint.Send(message);


            var receiveEndpoint = new Endpoint(_queue, serializer, transport, error,
                new InMemoryInboundMessageTracker(5));
            receiveEndpoint.Receive(o =>
                {
                    return b =>
                        {
                            var bb = (BugsBunny)b;
                            Console.WriteLine(bb.Food);
                        };
                }, TimeSpan.Zero);
        }
        public void EndpointSendAndReceive()
        {
            using (var management = new RabbitMqEndpointManagement(_queue))
            {
                management.BindQueue(_queue.Name, _exchange.Name, ExchangeType.Fanout, "", null);
            }

            IMessageSerializer serializer = new XmlMessageSerializer();

            var message = new BugsBunny {
                Food = "Carrot"
            };

            IDuplexTransport transport = _factory.BuildLoopback(new TransportSettings(_exchange));
            var sendEndpoint           = new Endpoint(_exchange, serializer, transport, null);

            sendEndpoint.Send(message);


            var receiveEndpoint = new Endpoint(_queue, serializer, transport, null);

            receiveEndpoint.Receive(o =>
            {
                return(b =>
                {
                    var bb = (BugsBunny)b;
                    Console.WriteLine(bb.Food);
                });
            }, TimeSpan.Zero);
        }
        public void EndpointSend()
        {
            var addr = new EndpointAddress(_address);

            IMessageSerializer ser = new XmlMessageSerializer();

            var msg = new BugsBunny()
            {
                Food = "Carrot"
            };

            using (var stream = new MemoryStream())
            {
                ser.Serialize(stream, msg);
            }
            var e = new RabbitMqEndpoint(addr, ser, new RabbitMqTransport(addr, _factory.CreateConnection(_rabbitAddress)), null);

            e.Send(new BugsBunny()
            {
                Food = "Carrot"
            });
        }