Search code examples
rabbitmqmasstransit

access to vhost refused for guest, with the MassTransit Sample-RequestResponse sample


I am using the default configuration on latest RabbitMQ server (guest is admin) but I get the next exception when I run the RequestResponse sample.

OperationInterruptedException: The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=530, text="NOT_ALLOWED - access to vhost 'test' refused for user 'guest'", classId=10, methodId=40, cause=

any ideas?


Solution

  • The sample is correct. The setting in App.config is:

    <add key="RabbitMQHost" value="rabbitmq://localhost/test"/>
    

    It means that MT will try connecting to the local instance, and test virtual host. Out of the box RabbitMQ has no virtual hosts configured and this is why you are getting this exception.

    What you could have done is, using the management plugin:

    1. Add the test virtual host to your RabbitMQ server configuration
    2. Add full permissions to that virtual host to your guest user

    And then it will work with the App.config without changes.