Skip Menu |

This queue is for tickets about the AnyEvent-RabbitMQ CPAN distribution.

Report information
The Basics
Id: 88213
Status: resolved
Priority: 0/
Queue: AnyEvent-RabbitMQ

People
Owner: DLAMBLEY [...] cpan.org
Requestors: rod.taylor [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.15
Fixed in: (no value)



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.
On Wed Aug 28 13:07:59 2013, rtaylor wrote: Show quoted text
> 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.
Thank you for you patch. I've merged in most of this in https://github.com/bobtfish/AnyEvent-RabbitMQ/pull/26 I couldn't confirm that "exchange" was a valid parameter to declare_queue(), so I have left this commented out. Cheers, Dave