Problem with Mass Transit connect to RabbitMq Cluster

1,178 views
Skip to first unread message

Joseph Oravec

unread,
Aug 24, 2017, 11:32:02 AM8/24/17
to masstransit-discuss
I am having an issue trying to get MassTransit to connect to my RabbitMQ cluster that is defined in Docker Containers.

I have 3 nodes in my cluster 

192.168.1.10:5672, 192.168.1.10:5673, 192.168.1.10:5674

I have the cluster running and can connect to each node successfully with the following code

var busControl = Bus.Factory.CreateUsingRabbitMq(cfg =>
{
    var host = cfg.Host(new Uri("rabbitmq://192.168.1.10:5672/"), h =>
    {
        h.Username("guest");
        h.Password("guest");
     });
});

When I try connect with the following code to connect to the cluster

var busControl = Bus.Factory.CreateUsingRabbitMq(cfg => { var host = cfg.Host(new Uri("rabbitmq://192.168.1.10/"), h => { h.Username("admin"); h.Password("admin"); h.UseCluster(c => { c.Node("192.168.1.10:5672"); c.Node("192.168.1.10:5673"); c.Node("192.168.1.10:5674"); }); }); });

I get the following error

MassTransit.RabbitMqTransport.RabbitMqConnectionException occurred
HResult=0x80131500
Message=Connect failed: admin@
192.168.1.10:5672/
Source=TestPublisher
StackTrace:
at TestPublisher.Program.Main(String[] args) in C:\_Dev\RMQClusterDemo\TestPublisher\Program.cs:line 50

Inner Exception 1:
BrokerUnreachableException: None of the specified endpoints were reachable

Inner Exception 2:
ConnectFailureException: Connection failed

Inner Exception 3:
SocketException: No such host is known

Any thoughts on how to get Masstransit to connect to the rabbitmq cluster?

Thanks

Chris Patterson

unread,
Aug 24, 2017, 12:42:02 PM8/24/17
to masstrans...@googlegroups.com
Using a cluster, the URI in the Host opening segment needs to be a "logical" host name, such as "MyCluster" - and not an IP address.


--
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-discuss+unsub...@googlegroups.com.
To post to this group, send email to masstransit-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/masstransit-discuss/1b364e1f-3231-45f4-83bd-098d6c2da0e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Joseph Oravec

unread,
Aug 24, 2017, 2:11:08 PM8/24/17
to masstransit-discuss

When I change it a host name like "MyCluster"  I then get the error

{"Connect failed: admin@mycluster:5672/"}

It appears it is not using the cluster ip list I provide


                        h.Username("admin");
                        h.Password("admin");
                        h.UseCluster(c =>
                        {
                            c.Node("192.168.1.10:5672");
                            c.Node("192.168.1.10:5673");
                            c.Node("192.168.1.10:5674");
                        });

Is there anything else I need to do?

Thanks
- show quoted text -
To post to this group, send email to masstrans...@googlegroups.com.

Vitaliy K

unread,
Dec 25, 2018, 4:49:48 PM12/25/18
to masstransit-discuss
Hey Chris,
I'm running cluster with nodes using SSL and non-standard ports, but default endpoint resolver (SequentialEndpointResolver) seems to use hostname only,
Is there a way to override resolver? 

Thanks


On Thursday, August 24, 2017 at 12:42:02 PM UTC-4, Chris Patterson wrote:
To post to this group, send email to masstrans...@googlegroups.com.

Vitaliy K

unread,
Dec 29, 2018, 1:59:23 PM12/29/18
to masstransit-discuss
I had exactly the same issue.
As of version  5.2 MassTransit requires all hosts to have same port.
Reply all
Reply to author
Forward
0 new messages