Subject: | Can't consume from a queue when message is moved to it from different queue by x-dead-letter mechanism |
Date: | Wed, 22 Nov 2017 11:51:06 +0100 |
To: | bug-Net-RabbitFoot [...] rt.cpan.org |
From: | Ivan Mitic <ivan.mitic [...] borderlinx.com> |
Hello,
When a message is moved from source_queue to dest_queue through
x-dead-letter mechanism, it's headers are modified and contain something
like this (taken from RabbitMQ Management):
headers:
x-death:
count: 1
reason: expired
queue: source_queue
time: 1511281957
exchange:
routing-keys: source_queue
A consumer with code like:
use Net::RabbitFoot;
my $connection = Net::RabbitFoot->new()->load_xml_spec()->connect(
host => 'localhost', port => '5672', user => 'guest', pass => 'guest',
vhost => '/',
);
my $channel = $connection->open_channel();
$channel->consume(
queue => 'dest_queue', on_consume => sub { print
shift()->{body}->{payload}; }
);
Will produce this:
EV: error in callback (ignoring): No way to unpack field 'count' type 'l'
at /usr/local/share/perl5/Net/AMQP/Common.pm line 265.
Environment:
$ perl -MNet::RabbitFoot -e 'print* $Net::RabbitFoot::VERSION* . "\n"'
*1.03*
$ *perl* -v
This is perl, *v5.10.1* (*) built for x86_64-linux-thread-multi
$ uname -a
Linux localhost.localdomain 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22
12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Thanks.
Regards,
*Ivan Mitic* | Senior Software Architect | Borderlinx
+381642513139
ivan.mitic@borderlinx.com