Skip Menu |

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

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

People
Owner: DLAMBLEY [...] cpan.org
Requestors: makita [...] blava.net
Cc:
AdminCc:

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



Subject: Confirm mode
Date: Mon, 5 May 2014 13:38:57 +0000
To: bug-AnyEvent-RabbitMQ [...] rt.cpan.org
From: Martin Kita <makita [...] blava.net>
Hi, can someone post me an example how to set the confirm mode? I can't read it from the documentation. Many thanks. Here is my code: connection = Net::RabbitFoot->new()->load_xml_spec()->connect( host => $conf->{cf}->{DST_HOST}, port => $conf->{cf}->{DST_PORT}, user => $conf->{cf}->{USER}, pass => $conf->{cf}->{PASS}, vhost => $conf->{cf}->{VHOST}, tune => { heartbeat => $conf->{cf}->{HEARTBEAT}, channel_max => 0, frame_max => 0 }, tls => $conf->{cf}->{SSL} ); $channel = $connection->open_channel(); $channel->declare_exchange( exchange => $conf->{cf}->{EXCHANGE}, passive => 1 ); $channel->{arc}->confirm( on_ack => \&ack, on_nack => \&nack, on_return => \&cb, on_inactive => \&inactive, ); $channel->publish( exchange => $conf->{cf}->{EXCHANGE}, header => Net::AMQP::Protocol::Basic::ContentHeader->new( content_type => 'application/json', content_encoding => 'UTF-8', headers => {}, delivery_mode => 1, priority => 1, message_id => $row->{cislo}, timestamp => time, user_id => $conf->{cf}->{USER}, ), body => $message, on_ack => \&ack, );
From looking at the code, it looks like you want to do, $channel->confirm(); and "confirm" mode will be set on the channel. I have never done this however! If this doesn't work, could you make a test case?