4
votes

I am trying to setup a variety of exchanges and queues in RabbitMQ via a script calling rabbitmqadmin. While I can declare a queue, I am not able to find any way to send 'x-dead-letter-exchange' or 'x-dead-letter-routing-key' arguments in the declaration. Is this possible?

2

2 Answers

10
votes

Yes, this is possible by specifying JSON in 'arguments' argument:

call rabbitmqadmin.py declare queue name=MyQueue arguments={\"x-dead-letter-exchange\":\"MyExchange\",\"x-dead-letter-routing-key\":\"MyRoutingKey\"}

Note: this is except from Windows batch file. (on other OS some syntax might be different)

2
votes

For those interested, the solution was to do 'rabbitmqadmin export rabbit.config', change the file to include the necessary exchanges, queues and bindings, then 'rabbitmqadmin import rabbit.config'. Not an optimal solution, but functional.