Subject: | declare_queue documentation |
It took me far too long to figure out how to use the x-expires parameter; so I've added some documentation in this area.
Subject: | rabbit_doc.patch |
*** ./RabbitMQ/Channel.pm.orig 2013-08-28 12:52:35.904962790 -0400
--- ./RabbitMQ/Channel.pm 2013-08-28 13:02:30.829071147 -0400
***************
*** 1025,1030 ****
--- 1025,1098 ----
=head2 declare_queue
+ my $done = AnyEvent->condvar;
+ $channel->declare_queue(
+ exchange => $queue_exchange,
+ queue => $queueName,
+ durable => 0,
+ auto_delete => 1,
+ passive => 0,
+ arguments => { 'x-expires' => 0, },
+ on_success => sub { $done->send; },
+ on_failure => sub {
+ say "Unable to create queue $queueName";
+ $done->send;
+ },
+ );
+ $done->recv;
+
+ Declare a queue (to publish messages to) on the server.
+
+ Arguments:
+
+ =over
+
+ =item on_success
+
+ =item on_failure
+
+ =item exchange
+
+ Exchange
+
+ =item queue
+
+ Name of the queue. This is the C<routing_key> for L<publish>.
+
+ =item durable
+
+ Default 0
+
+ =item auto_delete
+
+ Default 0
+
+ =item passive
+
+ Default 0
+
+ =item exchange
+
+ The name of the exchange
+
+ =item arguments
+
+ C<arguments> is a hashref of additional parameters which RabbitMQ extensions may use. This list is not
+ complete and your RabbitMQ server configuration will determine which arguments are valid and how they
+ act.
+
+ =over
+
+ =item x-expires
+
+ The queue will automatically be removed after being idle for this many milliseconds.
+
+ Default of 0 disables automatic queue removal.
+
+ =back
+
+ =back
+
=head2 bind_queue
Binds a queue to an exchange, with a routing key.