【发布时间】:2014-11-20 14:03:47
【问题描述】:
当 STOMP 客户端发送时,我可以让 RabbitMQ 3.4.1 创建名为“q123”的新 DURABLE 队列
SUBSCRIBE
destination: /amq/queue/q123
...
并将此队列用于以后的订阅?
【问题讨论】:
当 STOMP 客户端发送时,我可以让 RabbitMQ 3.4.1 创建名为“q123”的新 DURABLE 队列
SUBSCRIBE
destination: /amq/queue/q123
...
并将此队列用于以后的订阅?
【问题讨论】:
您无法在 STOMP 网关之外创建新队列。您可以SEND 和SUBSCRIBE 他们,但不能创建新的。
如果您在 STOMP 插件设置指定的 vhost 中引用 /queue/<your-queue-name>,STOMP 可能会为您创建它(默认情况下它是标准的 / vhost)。
所以这样的 STOMP 框架会在 / vhost 中创建 new-random-one 持久队列。
SUBSCRIBE
destination: /queue/new-random-one
这是在原始 shell 上运行它的方法(^@ 代表 Ctrl+@,重要的是空行):
nc localhost 61613
CONNECT
^@
CONNECTED
session:session-3IE6yYjn6borQ_4KLfxLMw
heart-beat:0,0
server:RabbitMQ/3.4.1
version:1.0
SUBSCRIBE
destination: /queue/new-random-one
^@
DISCONNECT
^@
所以在那之后,即使在断开连接后,您也会看到new-random-one 队列仍将驻留在默认虚拟主机中。
有关更多信息,请阅读 RabbitMQ STOMP Adapter 手册页的 Destinations 部分的详细信息。
【讨论】: