diff --git a/Changes b/Changes index e36d5d7..015fc0d 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension AnyEvent::RabbitMQ +1.04 Tue Jul 19 17:04:24 2011 + - Bug fix for consuming large messages. + 1.03 Thu Apr 7 02:55:12 2011 - Separate AnyEvent::RabbitMQ from Net::RabbitFoot. - Avoid (additional) issues when in global destruction. diff --git a/README b/README index af27809..a5f651b 100644 --- a/README +++ b/README @@ -10,7 +10,7 @@ You can use AnyEvent::RabbitMQ to - * Publish, consume, get, ack, recover and reject messages * Select, commit and rollback transactions -AnyEvent::RabbitMQ is known to work with RabbitMQ versions 2.4.0 and version 0-8 of the AMQP specification. +AnyEvent::RabbitMQ is known to work with RabbitMQ versions 2.5.1 and version 0-8 of the AMQP specification. INSTALLATION diff --git a/lib/AnyEvent/RabbitMQ.pm b/lib/AnyEvent/RabbitMQ.pm index 98f1729..9321d40 100644 --- a/lib/AnyEvent/RabbitMQ.pm +++ b/lib/AnyEvent/RabbitMQ.pm @@ -20,7 +20,7 @@ use Net::AMQP::Common qw(:all); use AnyEvent::RabbitMQ::Channel; use AnyEvent::RabbitMQ::LocalQueue; -our $VERSION = '1.03'; +our $VERSION = '1.04'; Readonly my $DEFAULT_AMQP_SPEC => File::ShareDir::dist_dir("AnyEvent-RabbitMQ") . '/fixed_amqp0-8.xml'; @@ -574,7 +574,7 @@ You can use AnyEvent::RabbitMQ to - * Publish, consume, get, ack, recover and reject messages * Select, commit and rollback transactions -AnyEvnet::RabbitMQ is known to work with RabbitMQ versions 2.4.0 and version 0-8 of the AMQP specification. +AnyEvnet::RabbitMQ is known to work with RabbitMQ versions 2.5.1 and version 0-8 of the AMQP specification. =head1 AUTHOR diff --git a/lib/AnyEvent/RabbitMQ/Channel.pm b/lib/AnyEvent/RabbitMQ/Channel.pm index ca3dc38..6cf3929 100644 --- a/lib/AnyEvent/RabbitMQ/Channel.pm +++ b/lib/AnyEvent/RabbitMQ/Channel.pm @@ -6,7 +6,7 @@ use warnings; use Scalar::Util qw(weaken); use AnyEvent::RabbitMQ::LocalQueue; -our $VERSION = '1.03'; +our $VERSION = '1.04'; sub new { my $class = shift; diff --git a/lib/AnyEvent/RabbitMQ/LocalQueue.pm b/lib/AnyEvent/RabbitMQ/LocalQueue.pm index 4169dc8..7bbbdc0 100644 --- a/lib/AnyEvent/RabbitMQ/LocalQueue.pm +++ b/lib/AnyEvent/RabbitMQ/LocalQueue.pm @@ -3,7 +3,7 @@ package AnyEvent::RabbitMQ::LocalQueue; use strict; use warnings; -our $VERSION = '1.03'; +our $VERSION = '1.04'; sub new { my $class = shift; diff --git a/xt/04_anyevent.t b/xt/04_anyevent.t index 1f231d4..ca3de56 100644 --- a/xt/04_anyevent.t +++ b/xt/04_anyevent.t @@ -32,7 +32,7 @@ eval { plan skip_all => 'Connection failure: ' . $conf{host} . ':' . $conf{port} if $@; -plan tests => 25; +plan tests => 31; use AnyEvent::RabbitMQ; @@ -167,6 +167,10 @@ $ch->get( ); $done->recv; +for my $size (10, 131_064, 200_000, 10, 999_999, 10) { + send_large_size_message($ch, $size); +} + $done = AnyEvent->condvar; $ch->consume( queue => 'test_q', @@ -319,7 +323,7 @@ SKIP: { }, on_failure => failure_cb($done), ); - publish( $ch, 'RabbitMQ is powerful.', $done, ); + publish($ch, 'RabbitMQ is powerful.', $done,); $done->recv; pass('reject'); }; @@ -431,3 +435,22 @@ sub publish { return; } +sub send_large_size_message { + my ($ch, $size,) = @_; + + my $done = AnyEvent->condvar; + publish($ch, 'a' x $size, $done,); + $ch->get( + queue => 'test_q', + on_success => sub { + my $response = shift; + is(length($response->{body}->payload), $size, 'get large size'); + $done->send; + }, + on_failure => failure_cb($done), + ); + $done->recv; + + return; +} +