From 4dece0a14ea2cc71725821266b8521aa087c5b55 Mon Sep 17 00:00:00 2001 From: David Wragg Date: Tue, 25 May 2010 10:33:49 +0100 Subject: Add docbook-based man pages for tools --- tools/Makefile.am | 23 ++++++ tools/common.c | 2 +- tools/doc/consume.xml | 173 ++++++++++++++++++++++++++++++++++++++++ tools/doc/get.xml | 95 ++++++++++++++++++++++ tools/doc/librabbitmq-tools.xml | 90 +++++++++++++++++++++ tools/doc/publish.xml | 160 +++++++++++++++++++++++++++++++++++++ 6 files changed, 542 insertions(+), 1 deletion(-) create mode 100644 tools/doc/consume.xml create mode 100644 tools/doc/get.xml create mode 100644 tools/doc/librabbitmq-tools.xml create mode 100644 tools/doc/publish.xml (limited to 'tools') diff --git a/tools/Makefile.am b/tools/Makefile.am index dc9603b..307fbd2 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -10,3 +10,26 @@ noinst_HEADERS = common.h amqp_publish_SOURCES = publish.c common.c amqp_get_SOURCES = get.c common.c amqp_consume_SOURCES = consume.c common.c + +if TOOLS_DOC +man_MANS = doc/amqp-publish.1 doc/amqp-consume.1 doc/amqp-get.1 doc/librabbitmq-tools.7 +MOSTLYCLEANFILES = doc/man-date.ent + +# automake complains about % pattern rules, and suffix rules don't +# support multiple dependencies, so we have to expand all these out. +doc/amqp-publish.1: doc/publish.xml doc/man-date.ent + $(XMLTO) man -o doc $< +doc/amqp-consume.1: doc/consume.xml doc/man-date.ent + $(XMLTO) man -o doc $< +doc/amqp-get.1: doc/get.xml doc/man-date.ent + $(XMLTO) man -o doc $< +doc/librabbitmq-tools.7: doc/librabbitmq-tools.xml doc/man-date.ent + $(XMLTO) man -o doc $< + +doc/man-date.ent: + date +'%Y-%m-%d' >$@ + +clean:: + rm -f doc/man-date.ent + +endif diff --git a/tools/common.c b/tools/common.c index 37fd301..6a38a95 100644 --- a/tools/common.c +++ b/tools/common.c @@ -187,7 +187,7 @@ static char *amqp_password = "guest"; const char *connect_options_title = "Connection options"; struct poptOption connect_options[] = { {"server", 's', POPT_ARG_STRING, &amqp_server, 0, - "the AMQP server to connect to", "server"}, + "the AMQP server to connect to", "hostname:port"}, {"vhost", 0, POPT_ARG_STRING, &amqp_vhost, 0, "the vhost to use when connecting", "vhost"}, {"username", 0, POPT_ARG_STRING, &amqp_username, 0, diff --git a/tools/doc/consume.xml b/tools/doc/consume.xml new file mode 100644 index 0000000..448ade6 --- /dev/null +++ b/tools/doc/consume.xml @@ -0,0 +1,173 @@ + + +] +> + + + RabbitMQ C Client + + The RabbitMQ Team <info@rabbitmq.com> + + &date; + + + + amqp-consume + 1 + RabbitMQ C Client + + + + amqp-consume + Consume messages from a queue on an AMQP server + + + + + amqp-consume + + OPTION + + + command + + + args + + + + + + Description + + amqp-consume consumes messages from a + queue on an AMQP server. For each message that arrives, a + receiving command is run, with the message body supplied + to it on standard input. + + + amqp-consume can consume from an + existing queue, or it can create a new queue. It can + optionally bind the queue to an existing exchange, or to a + newly created exchange. + + + By default, messages will be consumed with explicit + acknowledgements. A message will only be acknowledged if + the receiving command exits successfully (i.e. with an + exit code of zero). The AMQP no ack mode + (a.k.a. auto-ack mode) can be enable with the + option. + + + + + Options + + + + =queue name + + + The name of the queue to consume messages + from. If the specified queue does not exist, + an auto-delete queue is created with the given + name. If this option is omitted, a new + auto-delete queue will be created, with a + unique name assigned to the queue by the AMQP + server; that unique name will be displayed on + stderr. + + + + + + =exchange name + + + The name of the exchange to bind the queue to. + If omitted, binding is not performed. The + specified exchange should already exist unless + the option is + used to request the creation of an exchange. + + + + + + =type + + + This option indicates that an auto-delete + exchange of the specified type should be + created. The name of the exchange should be + given by the + option. + + + + + + =routing key + + + The routing key for the binding. If omitted, + an empty routing key is assumed. + + + + + + =routing key + + + Enable no ack mode: The AMQP + server will unconditionally acknowledge each + message that is delivered, regardless of + whether the target command exits successfully + or not. + + + + + + + + Examples + + + Consume messages from the queue + myqueue, and + output the message bodies on standard output via + cat: + + $ amqp-publish -q myqueue cat + + + + + Bind a newly created auto-delete queue to an + exchange myexch, and send + each message body to the script + myscript, automatically + acknowledging them on the server: + + $ amqp-consume -A -e myexch ./myscript + + + + + + + See also + + librabbitmq-tools7 + describes connection-related options common to all the + RabbitMQ C Client tools. + + + diff --git a/tools/doc/get.xml b/tools/doc/get.xml new file mode 100644 index 0000000..9770a8b --- /dev/null +++ b/tools/doc/get.xml @@ -0,0 +1,95 @@ + + +] +> + + + RabbitMQ C Client + + The RabbitMQ Team <info@rabbitmq.com> + + &date; + + + + amqp-get + 1 + RabbitMQ C Client + + + + amqp-get + Get a message from a queue on an AMQP server + + + + + amqp-get + + OPTION + + -q queue name + + + + + Description + + amqp-get attempts to consume a single + message from a queue on an AMQP server, and exits. Unless + the queue was empty, the body of the resulting message is + sent to standard output. + + + + + Options + + + + =queue name + + + The name of the queue to consume messages + from. + + + + + + + + Exit Status + + If the queue is not empty, and a message is successfully + retrieved, the exit status is 0. If an error occurs, the + exit status is 1. If the queue is found to be empty, the + exit status is 2. + + + + + Examples + + + Get a message from the queue myqueue, and + display its body on standard output: + + $ amqp-get -q myqueue + + + + + + + See also + + librabbitmq-tools7 + describes connection-related options common to all the + RabbitMQ C Client tools. + + + diff --git a/tools/doc/librabbitmq-tools.xml b/tools/doc/librabbitmq-tools.xml new file mode 100644 index 0000000..41f092a --- /dev/null +++ b/tools/doc/librabbitmq-tools.xml @@ -0,0 +1,90 @@ + + +] +> + + + RabbitMQ C Client + + The RabbitMQ Team <info@rabbitmq.com> + + &date; + + + + librabbitmq-tools + 7 + RabbitMQ C Client + + + + librabbitmq-tools + Command line AMQP tools + + + + Description + + A set of command line AMQP tools based on librabbitmq. This page + describes common options and conventions used by all of + the tools. + + + + + Common Options + + + + =hostname:port + + + The host name (or address) to connect to. + Defaults to localhost. The port number may + also be specified; if omitted, it defaults to + the standard AMQP port number (5672). + + + + + =vhost + + + The AMQP vhost to specify when connnecting. + Defaults to /. + + + + + =username + + + The username to authenticate to the AMQP server with. Defaults to guest. + + + + + =password + + + The password to authenticate to the AMQP server with. Defaults to guest. + + + + + + + + See also + + + amqp-publish1 + amqp-consume1 + amqp-get1 + + + + diff --git a/tools/doc/publish.xml b/tools/doc/publish.xml new file mode 100644 index 0000000..d2e8d2e --- /dev/null +++ b/tools/doc/publish.xml @@ -0,0 +1,160 @@ + + +] +> + + + RabbitMQ C Client + + The RabbitMQ Team <info@rabbitmq.com> + + &date; + + + + amqp-publish + 1 + RabbitMQ C Client + + + + amqp-publish + Publish a message on an AMQP server + + + + + amqp-publish + + OPTION + + + + + + Description + + Publishes a message to an exchange on an AMQP server. + Options allow the various properties of the message and + parameters of the AMQP basic.publish + method to be specified. + + + By default, the message body is read from standard input. + Alternatively, the option allows the message + body to be provided as part of the command. + + + + + Options + + + + =exchange name + + + The name of the exchange to publish to. If + omitted, the default exchange (also known as + the nameless exchange) is used. + + + + + + =routing key + + + The routing key to publish with. If omitted, + an empty routing key is assumed. A routing + key must be specified when publishing to the + default exchange; in that case, accoding to + the AMQP specification, the routing key + corresponds to a queue name. + + + + + + + + + Use the persistent delivery mode. Without + this option, non-persistent delivery is used. + + + + + + =MIME type + + + Specifies the content-type property for the + message. If omitted, the content-type + property is not set on the message. + + + + + + =content coding + + + Specifies the content-encoding property for + the message. If omitted, the content-encoding + property is not set on the message. + + + + + + =message body + + + Specifies the message body. If omitted, the + message body is read from standard input. + + + + + + + + Examples + + + Send a short message, consisting of the word + Hello to the queue + myqueue via the + default exchange: + + $ amqp-publish -r myqueue -b Hello + + + + + Send some XML data from a file to the exchange + events, with + persistent delivery mode, setting the content-type + property on the message to make the data format + explicit: + + $ amqp-publish -e events -p -C text/xml <event.xml + + + + + + + See also + + librabbitmq-tools7 + describes connection-related options common to all the + RabbitMQ C Client tools. + + + -- cgit v1.2.1