RabbitMQ server throws an error but locally it is working perfectly fine

1.6k views Asked by At

Setup:

  1. Masstransit verion: 2.10
  2. RabbitMq Client: 3.4.3.0
  3. RabbitMq Server : 3.5.3 (used default ports and configurations)
  4. Erlang 17.5

I can access the RabbitMQ web management client and able use the rabbitMQ locally. The problem is deployed in data center.

the code:

 ServiceBusFactory.New(sbc =>
        {
            sbc.UseRabbitMq(r => r.ConfigureHost(new Uri("rabbitmq://actual-server-name/queue-name"), h =>
            {
                h.SetUsername("username");
                h.SetPassword("password");
            }));
            sbc.ReceiveFrom("rabbitmq://actual-server-name/queue-name");
            sbc.Subscribe(x => x.LoadFrom(container));
        });

I got an exception error: It came from MassTransit.Exceptions.MassTransitException. When you dig down inside it from RabbitMQ itself.

RabbitMQ.Client.Exceptions.BrokerUnreachableException : None of the specified endpoints were reacheable.

System.IO.Exception : connection.start was never received, likely to a network timeout. found in Masstransit.ServiceContainer.cs line: 63

Why it throwing error; since the rabbitmq server installation is same in my local setting? permission issue? firewall issue?

2

There are 2 answers

1
altyne On

I observed and verified in my testing; masstransit does not allow creating of vhost from uri input. RabbitMQ will throw most likely the same error.

To resolve this issue, create the vhost and queue manually in rabbitmq server.

PS. I knew, this is not the same as the question ask.

0
krishna chaitanya On

One can create the queue through the code but not the vhost. So, you have to create the vhost manually and also give proper permissions to access via code.