我是RabbitMQ的新手,我必须实现一个.NET客户端,需要将消息发布到由第三方托管的RabbitMQ服务器上的Exchange实体。
与服务器的连接似乎运行良好,但是当我想要向我必须使用的Exchange声明一个频道时,事情变得更糟。
using (var connection = connectionFactory.CreateConnection())
{
IModel model = connection.CreateModel();
model.ExchangeDeclare(exchangeName, ExchangeType.Direct);
// ... the rest of the code is never reached
}
使用这些行,我从服务器收到一条带有此消息的例外
The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=403, text="ACCESS_REFUSED - access to exchange ... in vhost ... refused for user ...", classId=40, methodId=10, cause=
"Connection Closed, error code 403 (ACCESS_REFUSED)"
这是什么意思?这是否意味着为我提供连接到AMQP服务器的凭据的第三方尚未在Exchange“exchangeName”上授予足够的权限?或者我在客户端做错了什么?我真的需要拨打ExchangeDeclare
吗?
感谢您的帮助