Product SiteDocumentation Site

2.2. Command Line Tools

MRG Messaging contains a number of command line utilities for monitoring and configuring messaging brokers. http://cwiki.apache.org/qpid/mgmtc.html
qpid-config
Display and configure exchanges, queues, and bindings in the broker
qpid-tool
Access configuration, statistics, and control within the broker
qpid-queue-stats
Monitor the size and enqueue/dequeue rates of queues in a broker
perftest
Measures throughput on a variety of scenarios, using adjustable parameters
The command line utilities are included in the python client library package. Follow the installation instructions in the Messaging Installation Guide and install the python-qpid and amqp packages.

2.2.1. Using qpid-config

  1. View the full list of commands by running the qpid-config --help command from the shell prompt:
    $ qpid-config --help
    
    Usage:  qpid-config [OPTIONS]
    qpid-config [OPTIONS] exchanges [filter-string]
    qpid-config [OPTIONS] queues    [filter-string]
    qpid-config [OPTIONS] add exchange <type> <name> [AddExchangeOptions]
    qpid-config [OPTIONS] del exchange <name>
    ..[output truncated]...
    
  2. View a summary of all exchanges and queues by using the qpid-config without options:
    $ qpid-config
    
    Total Exchanges: 6
    	  topic: 2
    	headers: 1
    	 fanout: 1
    	 direct: 2
       Total Queues: 7
    	durable: 0
        non-durable: 7
    
  3. List information on all existing queues by using the queues command:
    $ qpid-config  queues
    
    					Store Size
    Durable  AutoDel  Excl  Bindings  (files x file pages)  Queue Name
    ===========================================================================================
      N	   N      N         1                          pub_start
      N        N      N         1                          pub_done
      N        N      N         1                          sub_ready
      N        N      N         1                          sub_done
      N        N      N         1                          perftest0
      N        Y      N         2                          mgmt-3206ff16-fb29-4a30-82ea-e76f50dd7d15
      N        Y      N         2                          repl-3206ff16-fb29-4a30-82ea-e76f50dd7d15
      N        Y      N         2                          mgmt-df06c7a6-4ce7-426a-9f66-da91a2a6a837
      N        Y      N         2                          repl-df06c7a6-4ce7-426a-9f66-da91a2a6a837
    
  4. Add new queues with the add queue command and the name of the queue to create:
    $ qpid-config add queue queue_name
    
  5. To delete a queue, use the del queue command with the name of the queue to remove:
    $ qpid-config del queue queue_name
    

    Note

    For more information on using qpid-config to manage queues, see Chapter 3, Queues.
  6. List information on all existing exchanges with the exchanges command. Add the -b option to also see binding information:
    $ qpid-config -b exchanges
    
    Exchange '' (direct)
    	bind pub_start => pub_start
    	bind pub_done => pub_done
    	bind sub_ready => sub_ready
    	bind sub_done => sub_done
    	bind perftest0 => perftest0
    	bind mgmt-3206ff16-fb29-4a30-82ea-e76f50dd7d15 => mgmt-3206ff16-fb29-4a30-82ea-e76f50dd7d15
    	bind repl-3206ff16-fb29-4a30-82ea-e76f50dd7d15 => repl-3206ff16-fb29-4a30-82ea-e76f50dd7d15
    Exchange 'amq.direct' (direct)
    	bind repl-3206ff16-fb29-4a30-82ea-e76f50dd7d15 => repl-3206ff16-fb29-4a30-82ea-e76f50dd7d15
    	bind repl-df06c7a6-4ce7-426a-9f66-da91a2a6a837 => repl-df06c7a6-4ce7-426a-9f66-da91a2a6a837
    	bind repl-c55915c2-2fda-43ee-9410-b1c1cbb3e4ae => repl-c55915c2-2fda-43ee-9410-b1c1cbb3e4ae
    Exchange 'amq.topic' (topic)
    Exchange 'amq.fanout' (fanout)
    Exchange 'amq.match' (headers)
    Exchange 'qpid.management' (topic)
    	bind mgmt.# => mgmt-3206ff16-fb29-4a30-82ea-e76f50dd7d15
    
  7. Add new exchanges with the add exchange command. Specify the type (direct, topic or fanout) along with the name of the exchange to create. You can also add the --durable option to make the exchange durable:
    $ qpid-config add exchange direct exchange_name --durable
    
  8. To delete a queue, use the del exchange command with the name of the exchange to remove:
    $ qpid-config del exchange exchange_name