amqp-publish.xml 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd"
  3. [
  4. <!ENTITY date SYSTEM "man-date.ent" >
  5. ]
  6. >
  7. <refentry lang="en">
  8. <refentryinfo>
  9. <productname>RabbitMQ C Client</productname>
  10. <authorgroup>
  11. <corpauthor>The RabbitMQ Team &lt;<ulink url="mailto:info@rabbitmq.com"><email>info@rabbitmq.com</email></ulink>&gt;</corpauthor>
  12. </authorgroup>
  13. <date>&date;</date>
  14. </refentryinfo>
  15. <refmeta>
  16. <refentrytitle>amqp-publish</refentrytitle>
  17. <manvolnum>1</manvolnum>
  18. <refmiscinfo class="manual">RabbitMQ C Client</refmiscinfo>
  19. </refmeta>
  20. <refnamediv>
  21. <refname>amqp-publish</refname>
  22. <refpurpose>Publish a message on an AMQP server</refpurpose>
  23. </refnamediv>
  24. <refsynopsisdiv>
  25. <cmdsynopsis>
  26. <command>amqp-publish</command>
  27. <arg choice="opt" rep="repeat">
  28. <replaceable>OPTION</replaceable>
  29. </arg>
  30. </cmdsynopsis>
  31. </refsynopsisdiv>
  32. <refsect1>
  33. <title>Description</title>
  34. <para>
  35. Publishes a message to an exchange on an AMQP server.
  36. Options allow the various properties of the message and
  37. parameters of the AMQP <function>basic.publish</function>
  38. method to be specified.
  39. </para>
  40. <para>
  41. By default, the message body is read from standard input.
  42. Alternatively, the <option>-b</option> option allows the message
  43. body to be provided as part of the command.
  44. </para>
  45. </refsect1>
  46. <refsect1>
  47. <title>Options</title>
  48. <variablelist>
  49. <varlistentry>
  50. <term><option>-e</option></term>
  51. <term><option>--exchange</option>=<replaceable class="parameter">exchange name</replaceable></term>
  52. <listitem>
  53. <para>
  54. The name of the exchange to publish to. If
  55. omitted, the default exchange (also known as
  56. the nameless exchange) is used.
  57. </para>
  58. </listitem>
  59. </varlistentry>
  60. <varlistentry>
  61. <term><option>-r</option></term>
  62. <term><option>--routing-key</option>=<replaceable class="parameter">routing key</replaceable></term>
  63. <listitem>
  64. <para>
  65. The routing key to publish with. If omitted,
  66. an empty routing key is assumed. A routing
  67. key must be specified when publishing to the
  68. default exchange; in that case, accoding to
  69. the AMQP specification, the routing key
  70. corresponds to a queue name.
  71. </para>
  72. </listitem>
  73. </varlistentry>
  74. <varlistentry>
  75. <term><option>-p</option></term>
  76. <term><option>--persistent</option></term>
  77. <listitem>
  78. <para>
  79. Use the persistent delivery mode. Without
  80. this option, non-persistent delivery is used.
  81. </para>
  82. </listitem>
  83. </varlistentry>
  84. <varlistentry>
  85. <term><option>-C</option></term>
  86. <term><option>--content-type</option>=<replaceable class="parameter">MIME type</replaceable></term>
  87. <listitem>
  88. <para>
  89. Specifies the content-type property for the
  90. message. If omitted, the content-type
  91. property is not set on the message.
  92. </para>
  93. </listitem>
  94. </varlistentry>
  95. <varlistentry>
  96. <term><option>-E</option></term>
  97. <term><option>--content-encoding</option>=<replaceable class="parameter">content coding</replaceable></term>
  98. <listitem>
  99. <para>
  100. Specifies the content-encoding property for
  101. the message. If omitted, the content-encoding
  102. property is not set on the message.
  103. </para>
  104. </listitem>
  105. </varlistentry>
  106. <varlistentry>
  107. <term><option>-b</option></term>
  108. <term><option>--body</option>=<replaceable class="parameter">message body</replaceable></term>
  109. <listitem>
  110. <para>
  111. Specifies the message body. If omitted, the
  112. message body is read from standard input.
  113. </para>
  114. </listitem>
  115. </varlistentry>
  116. <varlistentry>
  117. <term><option>-H</option></term>
  118. <term><option>--header</option>=<replaceable class="parameter">header</replaceable></term>
  119. <listitem>
  120. <para>
  121. Specifies an optional header in the form "key: value".
  122. </para>
  123. </listitem>
  124. </varlistentry>
  125. </variablelist>
  126. </refsect1>
  127. <refsect1>
  128. <title>Examples</title>
  129. <variablelist>
  130. <varlistentry>
  131. <term>Send a short message, consisting of the word
  132. <quote><literal>Hello</literal></quote> to the queue
  133. <quote><systemitem
  134. class="resource">myqueue</systemitem></quote> via the
  135. default exchange:</term>
  136. <listitem>
  137. <screen><prompt>$ </prompt><userinput>amqp-publish -r myqueue -b Hello</userinput></screen>
  138. </listitem>
  139. </varlistentry>
  140. <varlistentry>
  141. <term>Send some XML data from a file to the exchange
  142. <quote><systemitem
  143. class="resource">events</systemitem></quote>, with
  144. persistent delivery mode, setting the content-type
  145. property on the message to make the data format
  146. explicit:</term>
  147. <listitem>
  148. <screen><prompt>$ </prompt><userinput>amqp-publish -e events -p -C text/xml &lt;event.xml</userinput></screen>
  149. </listitem>
  150. </varlistentry>
  151. </variablelist>
  152. </refsect1>
  153. <refsect1>
  154. <title>See also</title>
  155. <para>
  156. <citerefentry><refentrytitle>librabbitmq-tools</refentrytitle><manvolnum>7</manvolnum></citerefentry>
  157. describes connection-related options common to all the
  158. RabbitMQ C Client tools.
  159. </para>
  160. </refsect1>
  161. </refentry>