简体   繁体   English

RabbitMQ 在虚拟主机“/”中找不到交换

[英]RabbitMQ Exchange not found in vhost "/'

I am trying to set up a retry system in my Rabbitmq setup.我正在尝试在我的 Rabbitmq 设置中设置重试系统。 In order to achieve this, I have to declare some exchanges, queues and create the necessary bindings between them.为了实现这一点,我必须声明一些交换、队列并在它们之间创建必要的绑定。 So I have something of this nature所以我有这种性质的东西

await subscriber.createExchange('TTL-PAYMENTS', 'direct')
await subscriber.createExchange('DLX-PAYMENTS', 'fanout')
await subscriber.createQueues('payments-retry-1-30s', 'DLX-PAYMENTS', 30000)
await subscriber.createQueues('payments-retry-2-50s', 'DLX-PAYMENTS', 50000)
await subscriber.bindExchanges('payments', 'DLX-PAYMETS')
await subscriber.bindExchanges('payments-retry-1-30s', 'TTL-PAYMETS', 'retry-1')
await subscriber.bindExchanges('payments-retry-2-50s', 'TTL-PAYMETS', 'retry-2')

But when I start up the server, I get this error但是当我启动服务器时,我得到了这个错误

Error: Channel closed by server: 404 (NOT-FOUND) with message "NOT_FOUND - no exchange 'DLX-PAYMETS' in vhost '/'"

When I check my rabbitmq management dashboard, I can see that the exchanges and necessary queues are created already.当我检查我的 rabbitmq 管理仪表板时,我可以看到已经创建了交换和必要的队列。 From my understanding, an exchange Is idempotent, meaning that if it doesn't exist it will be created, and if it does exist as long as nothing changes in exchange attributes, the exchange should remain the same.根据我的理解,交换是幂等的,这意味着如果它不存在,它将被创建,如果它存在,只要交换属性没有任何变化,交换应该保持不变。 So I am quite confused as to why this is happening.所以我很困惑为什么会这样。 What could I be doing wrong?我可能做错了什么? And how can I rectify this issue?我该如何纠正这个问题? Thank you very much!非常感谢!

Looks like there's a typo with DLX-PAYMETS, missing the N. You have created an exchange named DLX-PAYMENTS.看起来 DLX-PAYMETS 有一个错字,缺少 N。您创建了一个名为 DLX-PAYMENTS 的交易所。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM