本文介绍了操作失败:ExchangeBind;404 (NOT-FOUND) 带有消息“NOT_FOUND - 没有交换 'dead.letters-q.1'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如上一个问题所述,我正在尝试将 wascally npm 包与meteor 一起使用,但它抛出了似乎是关于我的交换的设置/配置错误

as referenced in a previous question, i'm trying to use the wascally npm package with meteor and it's throwing what seems to be a setup/config error about my exchanges

W20150925-14:22:34.692(-4)? (STDERR)
W20150925-14:22:34.693(-4)? (STDERR) /Users/rkstar/dev/projects/wacoosta/.meteor/local/isopacks/npm-container/npm/node_modules/wascally/node_modules/when/lib/fatal.js:12
W20150925-14:22:34.693(-4)? (STDERR)            throw e;
W20150925-14:22:34.693(-4)? (STDERR)                  ^
W20150925-14:22:34.694(-4)? (STDERR) Error: Operation failed: ExchangeBind; 404 (NOT-FOUND) with message "NOT_FOUND - no exchange 'dead.letters-q.1' in vhost 'jzywgjfv'"
W20150925-14:22:34.694(-4)? (STDERR)     at reply (/Users/rkstar/dev/projects/wacoosta/.meteor/local/isopacks/npm-container/npm/node_modules/wascally/node_modules/amqplib/lib/channel.js:126:17)
W20150925-14:22:34.694(-4)? (STDERR)     at Channel.C.accept (/Users/rkstar/dev/projects/wacoosta/.meteor/local/isopacks/npm-container/npm/node_modules/wascally/node_modules/amqplib/lib/channel.js:399:7)
W20150925-14:22:34.694(-4)? (STDERR)     at Connection.mainAccept [as accept] (/Users/rkstar/dev/projects/wacoosta/.meteor/local/isopacks/npm-container/npm/node_modules/wascally/node_modules/amqplib/lib/connection.js:62:33)
W20150925-14:22:34.694(-4)? (STDERR)     at Socket.go (/Users/rkstar/dev/projects/wacoosta/.meteor/local/isopacks/npm-container/npm/node_modules/wascally/node_modules/amqplib/lib/connection.js:465:48)
W20150925-14:22:34.694(-4)? (STDERR)     at Socket.emit (events.js:92:17)
W20150925-14:22:34.694(-4)? (STDERR)     at emitReadable_ (_stream_readable.js:427:10)
W20150925-14:22:34.694(-4)? (STDERR)     at emitReadable (_stream_readable.js:423:5)
W20150925-14:22:34.694(-4)? (STDERR)     at readableAddChunk (_stream_readable.js:166:9)
W20150925-14:22:34.695(-4)? (STDERR)     at Socket.Readable.push (_stream_readable.js:128:10)
W20150925-14:22:34.695(-4)? (STDERR)     at TCP.onread (net.js:529:21)

这是我的兔子配置:

{
    connection: {
      user: Meteor.settings.rabbitmq.username,
      pass: Meteor.settings.rabbitmq.password,
      server: Meteor.settings.rabbitmq.server,
      //port: 5672,
      //timeout: 2000
      vhost: Meteor.settings.rabbitmq.vhost
    },
    exchanges:[
      { name: messages.exchanges.dead, type: 'direct' },
      { name: messages.exchanges.tmdb, type: 'direct' },
      { name: messages.exchanges.graph, type: 'direct' }
    ],
    queues:[
      { name: messages.queues.tmdb.read, subscribe: false, durable: true, deadLetter: messages.exchanges.dead },
      { name: messages.queues.tmdb.dead, subscribe: false, durable: true, deadLetter: messages.exchanges.dead },
      { name: messages.queues.graph.read, subscribe: false, durable: true, deadLetter: messages.exchanges.dead },
      { name: messages.queues.graph.write, subscribe: false, durable: true, deadLetter: messages.exchanges.dead }
    ],
    bindings:[{
      exchange: messages.exchanges.tmdb,
      target: messages.queues.tmdb.read,
      keys: [
        messages.keys.tmdb.read.imdb,
        messages.keys.tmdb.read.movies,
        messages.keys.tmdb.read.tv,
        messages.keys.tmdb.read.credits,
        messages.keys.tmdb.read.people
      ]
    },{
      exchange: messages.exchanges.dead,
      target: messages.queues.dead,
      keys: [
        messages.keys.tmdb.dead,
        messages.keys.graph.dead
      ]
    },{
      exchange: messages.exchanges.graph,
      target: messages.queues.graph.read,
      keys: [
        messages.keys.graph.read.any,
        messages.keys.graph.read.movies,
        messages.keys.graph.read.tv,
        messages.keys.graph.read.people,
        messages.keys.graph.read.places
      ]
    },{
      exchange: messages.exchanges.graph,
      target: messages.queues.graph.write,
      keys: [
        messages.keys.graph.write.any,
        messages.keys.graph.write.movies,
        messages.keys.graph.write.tv,
        messages.keys.graph.write.people,
        messages.keys.graph.write.places,
        messages.keys.graph.write.relationships
      ]
    }
    ]
  }

我检查了我的 rabbitmq 管理面板,我已经明确地设置了死信交换和队列之间的绑定,所以我不确定它在说什么或如何解决它.

i checked in my rabbitmq admin panel and i've explicitly set up a binding between my dead letters exchange and queue, so i'm not sure what it's talking about or how to resolve it.

推荐答案

尤里卡!在深入研究代码并深入研究rabbitmq仪表板后,我发现了问题.

eureka! after some digging through the code and digging into the rabbitmq dashboard, i found the problem.

  exchanges:[
      { name: messages.exchanges.dead, type: 'direct' },
      { name: messages.exchanges.tmdb, type: 'direct' },
      { name: messages.exchanges.graph, type: 'direct' }
    ],
    queues:[
      { name: messages.queues.tmdb.read, subscribe: false, durable: true, deadLetter: messages.exchanges.dead },
      { name: messages.queues.tmdb.dead, subscribe: false, durable: true, deadLetter: messages.exchanges.dead },
      { name: messages.queues.graph.read, subscribe: false, durable: true, deadLetter: messages.exchanges.dead },
      { name: messages.queues.graph.write, subscribe: false, durable: true, deadLetter: messages.exchanges.dead }
    ]

我正在定义 messages.exchanges.dead 交换,并将其设置为我的各种队列的 deadLetter 交换.问题是 dead-letters.q1 队列 NOTqueues:[] 数组中定义.

i was defining the messages.exchanges.dead exchange, and setting that as the deadLetter exchange for my various queues. the problem was that the dead-letters.q1 queue was NOT being defined in the queues:[] array.

这意味着虽然 dead-letters-ex.1 交换存在并且可以将消息路由到它,但没有创建 dead-letters-q.1或可用于将这些消息路由到.

this meant that while the dead-letters-ex.1 exchange existed and could have messages routed to it, there was no dead-letters-q.1 created or available to route those messages to.

ExchangeBind; 404 (NOT-FOUND) with message "NOT_FOUND - no exchange 'dead.letters-q.1'

ExchangeBind 错误让我看到了队列与交换的绑定,这使我陷入了这个兔子洞,找到了一个解决方案(双关语).

the ExchangeBind error was what got me looking at the bindings of queues to exchanges which led me down this rabbit hole to a solution (pun intended).

现在我的配置是这样的:

now my config looks like this:

exchanges:[
  { name: messages.exchanges.dead, type: 'direct' },
  { name: messages.exchanges.tmdb, type: 'direct' },
  { name: messages.exchanges.graph, type: 'direct' }
],
queues:[
  { name: messages.queues.dead, subscribe: false, durable: false },
  { name: messages.queues.tmdb.read, subscribe: false, durable: false, deadLetter: messages.exchanges.dead },
  { name: messages.queues.tmdb.dead, subscribe: false, durable: false, deadLetter: messages.exchanges.dead },
  { name: messages.queues.graph.read, subscribe: false, durable: false, deadLetter: messages.exchanges.dead },
  { name: messages.queues.graph.write, subscribe: false, durable: false, deadLetter: messages.exchanges.dead }
]

而且我可以继续构建和调试应用程序的其他部分.

and i can continue building and debugging other parts of the application.

这篇关于操作失败:ExchangeBind;404 (NOT-FOUND) 带有消息“NOT_FOUND - 没有交换 'dead.letters-q.1'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 19:02