korovaisdead
korovaisdead

Reputation: 6341

RabbitMQ. Masstransit. Virtual Hosts.

how can I create virtual host from masstransit service bus configuration?

I mean, for example, I deployed my app to some new PC and it should create new virtual host for itself.

I'm trying do this like this:

var bus = ServiceBusFactory.New(sbc =>
            {
                sbc.UseRabbitMq();
                sbc.UseHealthMonitoring(10);
                sbc.ReceiveFrom("rabbitmq://localhost:5672/mynewcustomvhost/myqueue?temporary=true");
            });

But getting error:

"No Obvious Problems says ConfigurationResult"

Why so?

Upvotes: 1

Views: 1992

Answers (1)

Chrysalis
Chrysalis

Reputation: 4220

Try this:

ServiceBusFactory.New(sbc =>
{
  sbc.UseRabbitMq(r =>
                  {
                      r.ConfigureHost(new Uri("rabbitmq://hostname/vhost/queue"), h =>
                      {
                          h.SetUsername("username");
                          h.SetPassword("password");
                      });
                  });

  // other options
});

Upvotes: 1

Related Questions