[rabbitmq-discuss] Transaction

pangj pangj at riseup.net
Wed Jun 6 10:42:15 BST 2012


> 4) The subcriptor which received the message sends the ACK to RabbitMQ.


Hi,

May I ask the ack is sent automatically, or by hand with a method call?

I ask this because, my test script below, I don't know if the Perl 
client has sent an ACK to broker or not, when it finish receiving and 
handling the message.

use strict;
use Net::RabbitMQ;

my $channel = 1001;
my $queuename = "myqueue";
my $mq = Net::RabbitMQ->new();

$mq->connect("localhost", { vhost=>"/myhost", user => "***", password => 
"***" });
$mq->channel_open($channel);

while (1) {
     my $hashref = $mq->get($channel, $queuename);
     last unless defined $hashref;
     print $hashref->{message_count}, ": ", $hashref->{body},"\n";
}

$mq->disconnect();


Thanks.


More information about the rabbitmq-discuss mailing list