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