我想从 Erlang 客户端发送死信交换但尝试了几天但无法弄清楚如何通过 Ruby 客户端轻松发送它。
amqp_channel:call(Channel, #'queue.declare'{
queue = QueueName,
arguments = [{<<"x-dead-letter-exchange">>, <<"">>}, {<<"x-dead-letter-routing-key">>, <<"task_pool1">>}, {<<"x-message-ttl">>, UnhideInMinute*60000}],
durable = true}
),
io:format("DECLARED CHANNEL.~n"),
amqp_channel:cast(Channel,
#'basic.publish'{
exchange = <<"">>,
routing_key = QueueName
},
#amqp_msg{props = #'P_basic'{delivery_mode = 2},
payload = JsonMsg}
)
谢谢