I want to send Dead Letter Exchange from Erlang client but tried for few days but unable to figure out how while I can send it through Ruby client easily.
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}
)
Thanks
The problem is when you set the arguments.
Here is the code:
when you set the argument you have to specify also the type
(longstr, signedint)
.I bound a queue to the ex
"my_exchange"
then I published a message to the queue:"myqueue12"
and it worked correctly:Hope it helps.