Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MassTransit: specify uri with virtualhost

I am using MassTransit with RabbitMQ and I would like to take advantage of RabbitMQ virtual hosts. Other apps in my organization (not using MassTransit) have a convention of setting up virtual hosts for environments i.e. "myapp" and "myappUAT". I need to follow this convention, but I can't figure out how to specify a virtual host in my MassTransit uri.

Is this possible? If so how can I do it?

like image 991
Damian Avatar asked Jul 25 '13 20:07

Damian


1 Answers

rabbitmq://localhost/vhost_name/queue_name is all you need. We use vhosts for most things, and just try to keep it simple :)

You can see the code pulling it out here: https://github.com/MassTransit/MassTransit/blob/v2.7.2/src/Transports/MassTransit.Transports.RabbitMq/RabbitMqEndpointAddress.cs#L167

like image 82
Travis Avatar answered Nov 16 '22 10:11

Travis