'\" t
.\" Title: amqp-publish
.\" Author: The RabbitMQ Team <\m[blue]\fBinfo@rabbitmq.com\fR\m[]>
.\" Generator: DocBook XSL Stylesheets v1.75.2
.\" Date: 2011-01-01
.\" Manual: RabbitMQ C Client
.\" Source: RabbitMQ C Client
.\" Language: English
.\"
.TH "AMQP\-PUBLISH" "1" "2011\-01\-01" "RabbitMQ C Client" "RabbitMQ C Client"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
amqp-publish \- Publish a message on an AMQP server
.SH "SYNOPSIS"
.HP \w'\fBamqp\-publish\fR\ 'u
\fBamqp\-publish\fR [\fIOPTION\fR...]
.SH "DESCRIPTION"
.PP
Publishes a message to an exchange on an AMQP server\&. Options allow the various properties of the message and parameters of the AMQP
\fBbasic\&.publish\fR
method to be specified\&.
.PP
By default, the message body is read from standard input\&. Alternatively, the
\fB\-b\fR
option allows the message body to be provided as part of the command\&.
.SH "OPTIONS"
.PP
\fB\-e\fR, \fB\-\-exchange\fR=\fIexchange name\fR
.RS 4
The name of the exchange to publish to\&. If omitted, the default exchange (also known as the nameless exchange) is used\&.
.RE
.PP
\fB\-r\fR, \fB\-\-routing\-key\fR=\fIrouting key\fR
.RS 4
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\&.
.RE
.PP
\fB\-p\fR, \fB\-\-persistent\fR
.RS 4
Use the persistent delivery mode\&. Without this option, non\-persistent delivery is used\&.
.RE
.PP
\fB\-C\fR, \fB\-\-content\-type\fR=\fIMIME type\fR
.RS 4
Specifies the content\-type property for the message\&. If omitted, the content\-type property is not set on the message\&.
.RE
.PP
\fB\-E\fR, \fB\-\-content\-encoding\fR=\fIcontent coding\fR
.RS 4
Specifies the content\-encoding property for the message\&. If omitted, the content\-encoding property is not set on the message\&.
.RE
.PP
\fB\-b\fR, \fB\-\-body\fR=\fImessage body\fR
.RS 4
Specifies the message body\&. If omitted, the message body is read from standard input\&.
.RE
.SH "EXAMPLES"
.PP
Send a short message, consisting of the word \(lqHello\(rq to the queue \(lqmyqueue\(rq via the default exchange:
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
$ \fBamqp\-publish \-r myqueue \-b Hello\fR
.fi
.if n \{\
.RE
.\}
.RE
.PP
Send some XML data from a file to the exchange \(lqevents\(rq, with persistent delivery mode, setting the content\-type property on the message to make the data format explicit:
.RS 4
.sp
.if n \{\
.RS 4
.\}
.nf
$ \fBamqp\-publish \-e events \-p \-C text/xml \fR