rabbitmqadmin

226 views
Skip to first unread message

cw storm

unread,
Mar 30, 2015, 5:27:51 PM3/30/15
to rabbitm...@googlegroups.com
I have a silly question. Can I pass arguments to the rabbitmqadmin
command? Is below a valid syntax?

rabbitmqadmin declare queue name=xyz durable=true
arguments={ha-policy=all,policy=ha-all}

Phil

Michael Klishin

unread,
Mar 30, 2015, 5:30:45 PM3/30/15
to rabbitm...@googlegroups.com, cw storm
You can. You want to quote the command line parameter and strings inside of it:
'arguments={"x-message-ttl":86400000}'.
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Simon MacMullen

unread,
Mar 31, 2015, 5:50:30 AM3/31/15
to cw storm, rabbitm...@googlegroups.com
Michael pointed out the correct way to quote in this scenario, but I'll
just add that neither "ha-policy" nor "policy" are meaningful arguments
for a queue: you can specify them by quoting as Michael suggests, but
they won't do anything.

Cheers, Simon

cw storm

unread,
Mar 31, 2015, 3:00:55 PM3/31/15
to Simon MacMullen, rabbitm...@googlegroups.com
Thanks Simon and Michael. Actually, this would be more meaningful:

rabbitmqadmin declare queue name=xyz durable=true
'arguments={"ha-mode"=all,"ha-sync-mode"=automatic}'

cw storm

unread,
Mar 31, 2015, 4:30:58 PM3/31/15
to Simon MacMullen, rabbitm...@googlegroups.com
So I execute the command and got the "Could not parse JSON:
{"ha-mode":all,"ha-sync-mode":automatic}

cw storm

unread,
Mar 31, 2015, 4:32:42 PM3/31/15
to Simon MacMullen, rabbitm...@googlegroups.com
Maybe I need to escape special characters with "\"

Michael Klishin

unread,
Mar 31, 2015, 4:33:28 PM3/31/15
to cw storm, rabbitm...@googlegroups.com
On 31 March 2015 at 23:30:58, cw storm (cws...@gmail.com) wrote:
{"ha-mode":all,"ha-sync-mode":automatic} is not valid JSON.

{"ha-mode":"all","ha-sync-mode":"automatic"} is.

cw storm

unread,
Mar 31, 2015, 4:35:11 PM3/31/15
to Michael Klishin, rabbitm...@googlegroups.com
I have to escape the special characters with "\" and it works.

cw storm

unread,
Apr 1, 2015, 2:30:57 PM4/1/15
to Michael Klishin, rabbitm...@googlegroups.com
I have another question around rabbitmqadmin. In order to override
the existing queue attributes, you would first have to execute
"rabbitmqadmin delete queue=name" and then issue "rabbitmqadmin
declare queue..." steps.

cw storm

unread,
Apr 1, 2015, 2:31:31 PM4/1/15
to Michael Klishin, rabbitm...@googlegroups.com
Otherwise, you would get a "406 PRECONDITION FAILED.." message.
Reply all
Reply to author
Forward
0 new messages