.TH "amqp-publish" "1" .SH "NAME" amqp-publish \(em Publish a message on an AMQP server .SH "SYNOPSIS" .PP \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\fP method to be specified. .PP By default, the message body is read from standard input. Alternatively, the \fB-b\fP option allows the message body to be provided as part of the command. .SH "Options" .IP "\fB-e\fP" 10 .IP "\fB\-\-exchange\fP=\fIexchange name\fR" 10 The name of the exchange to publish to. If omitted, the default exchange (also known as the nameless exchange) is used. .IP "\fB-r\fP" 10 .IP "\fB\-\-routing-key\fP=\fIrouting key\fR" 10 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. .IP "\fB-p\fP" 10 .IP "\fB\-\-persistent\fP" 10 Use the persistent delivery mode. Without this option, non-persistent delivery is used. .IP "\fB-C\fP" 10 .IP "\fB\-\-content-type\fP=\fIMIME type\fR" 10 Specifies the content-type property for the message. If omitted, the content-type property is not set on the message. .IP "\fB-E\fP" 10 .IP "\fB\-\-content-encoding\fP=\fIcontent coding\fR" 10 Specifies the content-encoding property for the message. If omitted, the content-encoding property is not set on the message. .IP "\fB-b\fP" 10 .IP "\fB\-\-body\fP=\fImessage body\fR" 10 Specifies the message body. If omitted, the message body is read from standard input. .IP "\fB-H\fP" 10 .IP "\fB\-\-header\fP=\fIheader\fR" 10 Specifies an optional header in the form "key: value". .SH "Examples" .IP "Send a short message, consisting of the word ``\fI\fBHello\fP\fP'' to the queue ``\fI\fBmyqueue\fP\fP'' via the default exchange:" 10 .PP .nf $ .ft B amqp-publish \-r myqueue \-b Hello .ft .fi .IP "Send some XML data from a file to the exchange ``\fI\fBevents\fP\fP'', with persistent delivery mode, setting the content-type property on the message to make the data format explicit:" 10 .PP .nf $ .ft B amqp-publish \-e events \-p \-C text/xml event.xml .ft .fi .SH "See also" .PP \fBlibrabbitmq-tools\fP\fB(7)\fP describes connection-related options common to all the RabbitMQ C Client tools. .\" created by instant / docbook-to-man