doudouba4520 2011-04-09 19:50
浏览 143
已采纳

RabbitMQ:`rabbitmqctl list_exchanges`下的'direct'标题是什么意思?

If I create an exchange in rabbitmq using php's amqp class with exchange type set to direct and the only option specified is durable, then try to connect to that exchange in node.js, I get a Cannot redeclare exchange with different options error you see if you're options don't match.

However, as far as i can tell, i am using the exact same options (type direct, and option durable). So i did a test and created one exchange in php called php_exchange and one in node.js called node_exchange and ran rabbitmqctl list_exchanges and got some interesting output:

Listing exchanges ...
node_exchange   direct
amq.headers headers
amq.direct  direct
amq.match   headers
amq.fanout  fanout
    direct
php_exchange    direct
amq.topic   topic
...done.

What does the direct heading mean in this context (clearly it's not all exchanges of type direct, as it lists node_exchange as being of type direct)? How can i get node.js to create an identical amqp exchange (so that it won't fail when connecting to a durable exchange)?

I am using the PECL php amqp library and the node-amqp library (https://github.com/ry/node-amqp)

Thanks.

EDIT:

Here is the output of rabbitmqctl list_exchanges name type auto_delete internal arguments (with the other exchanges removed for brevity):

Listing exchanges ...
node_exchange   direct  false   false   []
php_exchange    direct  false   false   []
...done.
  • 写回答

1条回答 默认 最新

  • duanluo9369 2011-04-09 20:25
    关注

    That's not a heading - it's a consequence of a slightly confusing aspect of AMQP, which is that there's a direct exchange called "". This is the "default" exchange, to which all queues automatically get bound.

    In terms of your problem with PECL vs node-amqp, I don't use either of those, but maybe your exchanges differ in something other than type or durability. "rabbitmqctl list_exchanges name type auto_delete internal arguments" will add more columns to the table returned to show all the details of your exchanges. Or look at the management plugin.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥30 python代码,帮调试,帮帮忙吧