gpt4 book ai didi

c# - 拒绝访问创建的交换

转载 作者:太空宇宙 更新时间:2023-11-03 20:53:50 27 4
gpt4 key购买 nike

我是使用 C# 的 rabbitmq 的新手。我们正在尝试为 epex spot 创建一个 API,它在传输标签协议(protocol)中使用 AMQP,并为此使用 Rabbitmq。

我可以使用提供的凭据连接到 epex spot 的服务器。ConnectionFactory factory = new RabbitMQ.Client.ConnectionFactory();能够创建 channel

using (IConnection conn = factory.CreateConnection())
{
using (IModel channel = conn.CreateModel())
{

但是每当我尝试使用 DeclareExchange 或 DeclareQueue 时,我都会收到错误信息:

The AMQP operation was interrupted: AMQP close-reason, initiated by Peer, code=403, text="ACCESS_REFUSED - access to exchange 'M7.broadcastQueue.username' in vhost 'app' refused for user 'username'", classId=60, methodId=40

如果我尝试联系 epexspot 并请求许可,他们会说我们拥有所有必要的许可。你们能帮我解决这个问题吗?或者如果有人以前遇到过类似的问题?

最佳答案

您的权限设置不正确。必须运行此命令才能执行此操作:

rabbitmqctl set_permissions -p app username '.*' '.*' '.*'

“epexspot”的任何人都没有正确设置它们,或者试图限制该用户的读/写/配置权限。

我假设 this也是您的信息。解决此问题后,请在您提出此问题的所有地方跟进并提供有关解决方案的详细信息,以便其他人可以从中学习。


注意: RabbitMQ 团队监控 the rabbitmq-users mailing list并且只是偶尔在 StackOverflow 上回答问题。

关于c# - 拒绝访问创建的交换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52615384/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com