Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MassTransit- The host path must be empty or contain a single virtual host name

I'm totally new to RabbitMQ and MassTransit. I just have a code that worked in dev environment but in production I get the error mentioned in the title. Currently the configuration is as follows:

<source name="mdb" switchValue="All">
    <listeners>
      <add name="MM" type="Comp.MyTraceListener, Comp.Diagnostics"
           initializeData="rabbitmq://server.xxx.int/ProdRabbitCluster/MDB"
           username="prod" password="xxxxx" />
    </listeners>
  </source>'

Just to check I decompiled MassTransit DLL and found that it's because the "/ProdRabbitCluster/MDB" has more than one "/" separated segment.

So is this URL format simply invalid and should be changed? That value was given by customer's admins and I have no idea about their whole infrastructure and servers.

like image 337
Wiizl Avatar asked Oct 18 '25 06:10

Wiizl


1 Answers

The format of a URL for MassTransit using RabbitMQ is:

rabbitmq://hostname[:port]/virtual_host

There shouldn't be another '/' in the virtual host name. It may be legal for RabbitMQ, but it isn't legal for MassTransit. They'll need to rename the virtual host to not include a '/' in the name.

I don't understand why operations does things like this sometimes.

like image 185
Chris Patterson Avatar answered Oct 20 '25 22:10

Chris Patterson