summaryrefslogtreecommitdiff
path: root/tools/doc/declare_queue.xml
blob: 7e9da322c97e3ec7a87dea717cb80755237411c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd"
[
<!ENTITY date SYSTEM "man-date.ent" >
]
>
<refentry lang="en">
    <refentryinfo>
        <productname>RabbitMQ C Client</productname>
        <authorgroup>
            <corpauthor>The RabbitMQ Team &lt;<ulink url="mailto:info@rabbitmq.com"><email>info@rabbitmq.com</email></ulink>&gt;</corpauthor>
        </authorgroup>
        <date>&date;</date>
    </refentryinfo>

    <refmeta>
        <refentrytitle>amqp-declare-queue</refentrytitle>
        <manvolnum>1</manvolnum>
        <refmiscinfo class="manual">RabbitMQ C Client</refmiscinfo>
    </refmeta>

    <refnamediv>
        <refname>amqp-declare-queue</refname>
        <refpurpose>Declare (create or assert the existence of) a queue on an AMQP server</refpurpose>
    </refnamediv>

    <refsynopsisdiv>
        <cmdsynopsis>
            <command>amqp-declare-queue</command>
            <arg choice="opt" rep="repeat">
                <replaceable>OPTION</replaceable>
            </arg>
            <arg choice="opt">-d</arg>
            <arg choice="req">-q <replaceable>queue name</replaceable></arg>
        </cmdsynopsis>
    </refsynopsisdiv>
    
    <refsect1>
        <title>Description</title>
        <para>
            <command>amqp-declare-queue</command> attempts to create a
            queue on an AMQP server, and exits. If the empty-string is
            supplied as the queue name, a fresh queue name is
            generated by the server and returned. In all cases, if a
            queue was successfully declared, the (raw binary) name of
            the queue is printed to standard output, followed by a
            newline.
        </para>
    </refsect1>

    <refsect1>
        <title>Options</title>
        <variablelist>
            <varlistentry>
                <term><option>-q</option></term>
                <term><option>--queue</option>=<replaceable class="parameter">queue name</replaceable></term>
                <listitem>
                    <para>
                        The name of the queue to declare.  If the
                        empty string is supplied, a fresh queue name
                        is generated by the server.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term><option>-d</option></term>
                <term><option>--durable</option></term>
                <listitem>
                    <para>
		      Causes the queue to be declared with the
		      "durable" flag set. Durable queues survive
		      server restarts. By default, queues are declared
		      in "transient" mode.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsect1>

    <refsect1>
        <title>Exit Status</title>
        <para>
            If the queue was successfully declared, the exit status is
            0. If an error occurs, the exit status is 1.
        </para>
    </refsect1>

    <refsect1>
        <title>Examples</title>
        <variablelist>
            <varlistentry>
                <term>Declare the durable queue <quote><systemitem
                class="resource">myqueue</systemitem></quote>, and
                display the name of the queue on standard output:</term>
                <listitem>
                    <screen><prompt>$ </prompt><userinput>amqp-declare-queue -d -q myqueue</userinput>
myqueue</screen>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>Declare a fresh, server-named transient queue,
                and display the name of the queue on standard output
                (use <citerefentry><refentrytitle>amqp-delete-queue</refentrytitle>
		    <manvolnum>1</manvolnum></citerefentry> to delete
		    it from the server once you're done):</term>
                <listitem>
                    <screen><prompt>$ </prompt><userinput>amqp-declare-queue -q ""</userinput>
amq.gen-BW/wvociA8g6LFpb1PlqOA==</screen>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsect1>

    <refsect1>
        <title>See also</title>
        <para>
            <citerefentry><refentrytitle>librabbitmq-tools</refentrytitle><manvolnum>7</manvolnum></citerefentry>
            describes connection-related options common to all the
            RabbitMQ C Client tools.
        </para>
    </refsect1>
</refentry>