2017-02-23 195 views
1

我已經按照this文章成功安排了郵件,但是當我將延遲郵件發佈到綁定隊列時。我無法立即在隊列中看到消息。 x-delayed-type交換插件緩衝的消息在某處直到時間到了。查看RabbitMQ管理界面中的延遲郵件

是否有反正(配置)在延遲時間到期之前在管理插件中看到這些延遲的消息?

+0

文章鏈接丟失 – cantSleepNow

+1

對不起,我已經編輯了問題,現在 –

回答

2

延遲信息都存儲在Mnesia,如:

enter image description here

所以你不能看到它的管理界面內。

編輯

您使用雲:

rabbitmqctl eval 'ets:tab2list([email protected]_HOST_NAME).'

例如: ➜ sbin ./rabbitmqctl eval 'ets:tab2list([email protected]).' [{delay_entry, {delay_key,1487934959224, {exchange, {resource,<<"/">>,exchange,<<"my-exchange">>}, 'x-delayed-message',true,false,false, [{<<"x-delayed-type">>,longstr,<<"direct">>}], undefined,undefined, {[],[]}}}, {delivery,false,false,<10495.911.0>, {basic_message, {resource,<<"/">>,exchange,<<"my-exchange">>}, [<<>>], {content,60, {'P_basic',undefined,undefined, [{<<"x-delay">>,signedint,90000}], undefined,undefined,undefined,undefined,undefined, undefined,undefined,undefined,undefined,undefined, undefined}, <<32,0,0,0,0,13,7,120,45,100,101,108,97,121,73,0,1,95,144>>, rabbit_framing_amqp_0_9_1, [<<"delayed payload">>]}, <<174,59,245,237,135,189,175,240,121,105,31,191,47,97,189,156>>, false}, undefined,noflow}, #Ref<10495.0.1.3514>},

(在playload可能是不可讀)

EDIT2

此功能將可爲首發版本3.7.0

https://github.com/rabbitmq/rabbitmq-delayed-message-exchange/issues/3

+0

謝謝你的答案,我不知道是否有任何可視化或管理工具看到Mnesia的延遲消息的Windows? –

+0

你在我的答案中看到的是'observer'工具,是erlang的調試工具。 有沒有可視化工具,你可以通過使用'rabbitmqctl eval ......'來查詢mensia talbe現在我不記得erlang命令了。 :( – Gabriele

+0

感謝您的關注,我會搜索該問題 –

0

如果你真的需要查看您在管理UI消息,如果你不能等待3.7.0如前所述通過Gabriele,您可以忽略該插件,而是將TTL和DLX結合在一起以延遲消息傳遞。

您可以將消息發佈到將在TTL之後過期消息的隊列(並且您可以從該隊列中查看消息)。然後,您可以使用死信路由密鑰將消息重新路由到交換機,以便消息以您使用的隊列結尾,如所述。

# declare a queue with the DELAYED_QUEUE name 
ch.queue(DELAYED_QUEUE, arguments: { 
    # set the dead-letter exchange to the default queue 
    'x-dead-letter-exchange' => '', 
    # set the routing key into the destination queue name 
    'x-dead-letter-routing-key' => DESTINATION_QUEUE, 
    # the time in milliseconds to keep the message in the queue 
    'x-message-ttl' => 3000 
}) 
# publish to the default exchange with the the delayed queue name 
# as routing key, so that the message ends up in the delayed queue 
ch.default_exchange.publish 'message content', routing_key: DELAYED_QUEUE