Pregunta

In Java there is option:

  • queue - the name of the queue
  • durable: true - if we are declaring a durable queue (the queue will survive a server restart)
  • exclusive: true - if we are declaring an exclusive queue (restricted to this connection)
  • autoDelete: true - if we are declaring an autodelete queue (server will delete it when no longer in use)
  • arguments: other - properties (construction arguments) for the queue

channel.queueDeclare(endPointName, true, false, false, null);

for rabbitmqadmin, commandline How to pass parameter for exclusive=false using rabbitmqadmin command line tool?

The documentation for rabbitmqadmin tool doesnt have an example for this usecase.

I am looking for shell script command like this:

rabbitmqadmin declare queue name="endPointName" durable=true exclusive=false arguments={"x-message-ttl":86400000}
¿Fue útil?

Solución

By default if no expires argument set, false value used, so you have to pass it via argument json-formated argument. The shell command should looks like this:

$ rabbitmqadmin declare queue name=endPointName durable=true arguments='{"exclusive":false,"x-message-ttl":86400000}'
queue declared

Make sure you have valid json strnig, unless you'll get formatting issue. Also, wrap json string in single quotes or double quotes inside will be removed.

And then will see in management panel something like this:

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top