Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top