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

2

6

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?

Priestley answered 9/9, 2017 at 22:10 Comment(0)
N
4

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.

Nonferrous answered 10/9, 2017 at 7:46 Comment(1)
how doi add full permissions for guest?Gokey
P
0

You can try using rabbitmqctl and set_permissions

$ rabbitmqctl set_permissions -p "custom-vhost" "username" ".*" ".*" ".*"

https://www.rabbitmq.com/docs/access-control#user-management

Pigpen answered 2/5, 2024 at 15:42 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.