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