Skip Menu |

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

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

People
Owner: DLAMBLEY [...] cpan.org
Requestors: ewoolley [...] adobe.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.17



Subject: Please make changes to add support for exchange binding
Date: Thu, 8 May 2014 15:49:53 +0000
To: "bug-AnyEvent-RabbitMQ [...] rt.cpan.org" <bug-AnyEvent-RabbitMQ [...] rt.cpan.org>
From: Evan Woolley <ewoolley [...] adobe.com>
I had to patch my build as follows to get it to work. diff -aur AnyEvent-RabbitMQ-1.16/lib/AnyEvent/RabbitMQ/Channel.pm AnyEvent-RabbitMQ-1.16.new/lib/AnyEvent/RabbitMQ/Channel.pm --- AnyEvent-RabbitMQ-1.16/lib/AnyEvent/RabbitMQ/Channel.pm 2014-04-12 07:41:18.000000000 -0600 +++ AnyEvent-RabbitMQ-1.16.new/lib/AnyEvent/RabbitMQ/Channel.pm 2014-05-07 13:24:50.034804840 -0600 @@ -277,6 +277,49 @@ ); } +sub bind_exchange { + my $self = shift; + my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); + + return $self if !$self->_check_open($failure_cb); + + $self->{connection}->_push_write_and_read( + 'Exchange::Bind', + { + %args, # queue, exchange, routing_key + ticket => 0, + nowait => 0, # FIXME + }, + 'Exchange::BindOk', + $cb, + $failure_cb, + $self->{id}, + ); + + return $self; +} + +sub unbind_exchange { + my $self = shift; + my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); + + return $self if !$self->_check_open($failure_cb); + + $self->{connection}->_push_write_and_read( + 'Exchange::Unbind', + { + %args, # queue, exchange, routing_key + ticket => 0, + }, + 'Exchange::UnbindOk', + $cb, + $failure_cb, + $self->{id}, + ); + + return $self; +} + sub bind_queue { my $self = shift; my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); @@ -1021,6 +1064,32 @@ =back +=head2 bind_exchange + +Binds an exchange to another exchange, with a routing key. + +Arguments: + +=over + +=item destination + +The name of the exchange to route messages into + +=item source + +The source exchange + +=item routing_key + +=item nowait + +=item arguments + +=back + +=head2 unbind_exchange + =head2 delete_exchange =head2 declare_queue Thanks, Evan Woolley
On Thu May 08 11:50:08 2014, ewoolley@adobe.com wrote: Show quoted text
> I had to patch my build as follows to get it to work. > > > diff -aur AnyEvent-RabbitMQ-1.16/lib/AnyEvent/RabbitMQ/Channel.pm > AnyEvent-RabbitMQ-1.16.new/lib/AnyEvent/RabbitMQ/Channel.pm > --- AnyEvent-RabbitMQ-1.16/lib/AnyEvent/RabbitMQ/Channel.pm 2014- > 04-12 07:41:18.000000000 -0600 > +++ AnyEvent-RabbitMQ-1.16.new/lib/AnyEvent/RabbitMQ/Channel.pm > 2014-05-07 13:24:50.034804840 -0600 > @@ -277,6 +277,49 @@ > ); > } > > +sub bind_exchange { > + my $self = shift; > + my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); > + > + return $self if !$self->_check_open($failure_cb); > + > + $self->{connection}->_push_write_and_read( > + 'Exchange::Bind', > + { > + %args, # queue, exchange, routing_key > + ticket => 0, > + nowait => 0, # FIXME > + }, > + 'Exchange::BindOk', > + $cb, > + $failure_cb, > + $self->{id}, > + ); > + > + return $self; > +} > + > +sub unbind_exchange { > + my $self = shift; > + my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); > + > + return $self if !$self->_check_open($failure_cb); > + > + $self->{connection}->_push_write_and_read( > + 'Exchange::Unbind', > + { > + %args, # queue, exchange, routing_key > + ticket => 0, > + }, > + 'Exchange::UnbindOk', > + $cb, > + $failure_cb, > + $self->{id}, > + ); > + > + return $self; > +} > + > sub bind_queue { > my $self = shift; > my ($cb, $failure_cb, %args) = $self->_delete_cbs(@_); > @@ -1021,6 +1064,32 @@ > > =back > > +=head2 bind_exchange > + > +Binds an exchange to another exchange, with a routing key. > + > +Arguments: > + > +=over > + > +=item destination > + > +The name of the exchange to route messages into > + > +=item source > + > +The source exchange > + > +=item routing_key > + > +=item nowait > + > +=item arguments > + > +=back > + > +=head2 unbind_exchange > + > =head2 delete_exchange > > =head2 declare_queue > > > > > Thanks, > > Evan Woolley
Thank you for your patch! It looks like it was merged in 2014, so I'll close this ticket. The commit was https://github.com/bobtfish/AnyEvent-RabbitMQ/commit/5fcd8a1f45a1f2fd9f46eb2de21d741c08e497e5 All the best, Dave