1

I have problem to connect MassTransit with RabbitMq on CloudAMQP. Below is my code

var bus = Bus.Factory.CreateUsingRabbitMq(otions => {
    var host = otions.Host(new Uri("rabbitmq://llama-01.rmq.cloudamqp.com"),
    h => { h.Username("my_username"); h.Password("my_password"); });
    otions.ReceiveEndpoint(host, "recvqueue", ep => {
        ep.Handler<Communicate>(Handle);
    });
});

bus.Start();

h.Password and h.Username are correct. While I try to start the bus I get following error:

RabbitMQ Connect Failed: Broker unreachable: my_username@llama-01.rmq.cloudamqp.com:5672/

I suspect that the problem is in URI address but I can't find out the correct one.

SigGP
  • 716
  • 1
  • 11
  • 24

2 Answers2

3

Well, I quickly browsed their Getting Started and I can see that your instance gets a vhost that has the same name as your user.

enter image description here

The image above is what I've got after subscribing to a free plan.

For MassTransit, you either need to add the vhost at the end of your connection string, like rabbitmq://llama-01.rmq.cloudamqp.com/my_username, or configure it in the host configuration, along with the username and password.

Alexey Zimarev
  • 17,944
  • 2
  • 55
  • 83
1

"Host": "cow-01.rmq2.cloudamqp.com", "Username": "mw****jh", "Password": "Oev7ZC4**cq61ch7u", "VirtualHost": "/mwwjh", "Port": 5672 If the JSON structure is to be used on the host, use this format for cloud

Umut Oku
  • 21
  • 1