MassTransit 3.0.5 with RabbitMQ - getting AMQP handshake_timeout when trying to send

172 views
Skip to first unread message

Annie Ju

unread,
May 26, 2015, 9:49:36 PM5/26/15
to masstrans...@googlegroups.com
Hi,

I implemented the following using  MassTransit 2.9.9, publishing messages to a remote RabbitMQ exchange, which binds to a queue, that appears to be working well.
The message are sent and routed to the queue that is bound to the exchange, and the messages are consumed by a broker.


//  Code for MassTransit 2.9.9 with RabbitMQ.Client 3.4.3

            var uri = new Uri("rabbitmq://<remote_host>/<exchange>");
            var bus = ServiceBusFactory.New((config) =>
            {
                config.UseRabbitMq(r =>
                {
                    r.ConfigureHost(uri, h =>
                    {
                        h.SetUsername("user");
                        h.SetPassword("passwd");
                    });
                });
                config.ReceiveFrom("rabbitmq://<remote_host>/<some_queue>");  // Not using this queue, as this program only publish, doesn't consume
            });

            var message = new MyMessage { Text = "Hi" };

            bus.Publish(message);


Now when I try to convert it to MassTransit 3.0.5-alpha, I'm getting the following error in the RabbitMQ log on the remote host:

=INFO REPORT==== 26-May-2015::18:15:48 ===
accepting AMQP connection <0.6465.2> (<remote_host>:64881 -> <remote_host>:5672)

=ERROR REPORT==== 26-May-2015::18:15:58 ===
closing AMQP connection <0.6465.2> (<remote_host>:64881 -> <remote_host>:5672):
{handshake_timeout,frame_header}



Here's the code:

// MassTransit 3.0.5 with RabbitMQ.Client 3.5.2


            const string host = "rabbitmq://<remote_host>/"; // using default virtual host at /
            _hostAddress = new Uri(host);
            _queueAddress = new Uri(host + "<exchange>");
            _bus = Bus.Factory.CreateUsingRabbitMq  (x =>
            {
                x.Host(_hostAddress, h =>
                {
                        h.SetUsername("user");
                        h.SetPassword("passwd");
                });
            });

            _busHandle = _bus.Start();

            var message = new MyMessage { Text = "Hi" };

 // It times out somewhere after this:
            ISendEndpoint endpoint = await _bus.GetSendEndpoint(_queueAddress);
            await endpoint.Send(message);


I looked at the code examples available online, and couldn't figure out why it doesn't work.
Any ideas?


Thanks,
Annie




Chris Patterson

unread,
May 26, 2015, 10:53:21 PM5/26/15
to masstrans...@googlegroups.com
Yeah default virtual host is still broken, even in 3.0.6 - I'll fix it by .7 - promise :)


--
You received this message because you are subscribed to the Google Groups "masstransit-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to masstransit-dis...@googlegroups.com.
To post to this group, send email to masstrans...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/1177952a-2d3f-4989-8779-dd10cd96cc3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages