Search code examples
rabbitmqpika

How to add Queue Description at Rabbitmq Admin UI using Pika library?


We are using pika library to declare exchange and queues as mentioned in the example below,

queue_declare(queue='process_messages_dx', durable=True)

Now, How to add Queue Description such that Admin UI user(Administrator, DevOps team) gets the knowledge of what this queue's function is. Kind of metadata of the Queue.

Reference: https://pika.readthedocs.io/en/stable/modules/adapters/blocking.html?highlight=queue_declare#pika.adapters.blocking_connection.BlockingChannel.queue_declare

enter image description here


Solution

  • It should be possible by just adding arguments as mentioned in the Pika Documentation,

    metadata = {
      "about": "Contains notification messages sent from the system. Consumed by the Flash to deliver content to Justice League.",
      "service": "earth"
    }
    
    queue_declare(queue='process_messages_dx', durable=True, arguments=metadata)