Monday, 9 June 2014

Clear QPID Queues and delete them

1. Connect to Qpid:
    # qpid-tool

2.  List the Queues:
   qpid:  list queue
 
     Object Summary:
    ID   Created   Destroyed  Index
    ===============================================================
    154  02:05:42  -          175.ax-q-myqueue2
    155  07:14:00  -          175.ax-q-myqueue1
    156  07:15:36  -          175.ax-q-myqueue1-dl


3. To delete the Queue use the below command:
    qpid: call 154 purge 0 {}
    qpid: OK (0) - {}

    Here, '154' is the ID of the Queue.

4. Press Ctrl + c to come out of QPID terminal.

5. Run the below command to see if the Messages are cleared:
    # qpid-stat -q

Queues
  queue                            dur  autoDel  excl  msg   msgIn  msgOut  bytes  bytesIn  bytesOut  cons  bind
  ================================================================================================================
  ax-q-solar-myqueue1-dl          Y                      0   589    589       0    553k     553k        0     2
  ax-q-solar-myqueue1           Y                      0   589    589       0    553k     553k        0     2
  ax-q-myqueue2                     Y                      0   330    330       0    250k     250k        0     2


6. Delete the Queue using the below command:
   #  qpid-config del queue ax-q-solar-myqueue1

    Here 'ax-q-solar-myqueue1' is the queue name.


1 comment:

  1. If message in queue then you should use qpid-config del queue ax-q-solar-myqueue1 --force

    ReplyDelete