Skip to content

Instantly share code, notes, and snippets.

@mortymacs
Created August 2, 2017 07:29
Show Gist options
  • Select an option

  • Save mortymacs/7a1e8470b2b45d019306f340a2bd24c5 to your computer and use it in GitHub Desktop.

Select an option

Save mortymacs/7a1e8470b2b45d019306f340a2bd24c5 to your computer and use it in GitHub Desktop.
RabbitMQ Useful Commands

List of queue:

rabbitmqadmin list queues

Create a queue:

rabbitmqadmin declare queue --vhost=/ name=my_queue

Publish message to queue:

rabbitmqadmin publish exchange=amq.default routing_key=test payload="hello mate!"

Read queue list:

rabbitmqadmin get queue=my_queue requeue=false

Set expire time on queue (set policy):

rabbitmqctl set_policy TTL ".*" '{"message-ttl": 500}' --apply-to queues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment