Managing the C++ Broker
There are quite a few ways to interact with the C++ broker. The command line tools
include:
- qpid-route - used to configure federation (a set of federated brokers)
- qpid-config - used to configure queues, exchanges, bindings and list them etc
- qpid-mgmt - used to view management information/statistics and call any management actions on the broker
Using qpid-config
This utility can be used to create queues exchanges and bindings, both durable and transient. Always check for latest options by running --help command.
$ ./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> qpid-config OPTIONS add queue <name> AddQueueOptions qpid-config OPTIONS del queue <name> qpid-config OPTIONS bind <exchange-name> <queue-name> binding-key qpid-config OPTIONS unbind <exchange-name> <queue-name> binding-key Options: -b [ --bindings ] Show bindings in queue or exchange list -a [ --broker-addr ] Address (localhost) Address of qpidd broker broker-addr is in the form: hostname | ip-address :<port> ex: localhost, 10.1.1.7:10000, broker-host:10000 -s [ --spec-file] Path (/usr/share/amqp/amqp.0-10-preview.xml) AMQP specification file Add Queue Options: --durable Queue is durable --file-count N (8) Number of files in queue's persistence journal --file-size N (24) File size in pages (64Kib/page) Add Exchange Options: --durable Exchange is durable
Get the summary page
./qpid-config Total Exchanges: 6 topic: 2 headers: 1 fanout: 1 direct: 2 Total Queues: 7 durable: 0 non-durable: 7
List the queues
$ ./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
List the exchanges with bindings
$ ./qpid-config -s ../../specs/amqp.0-10-preview.xml -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