Net-AMQP-RabbitMQ-PP
view release on metacpan or search on metacpan
# NAME
Net::AMQP::RabbitMQ::PP - Pure perl AMQP client for RabbitMQ
# SYNOPSIS
use Net::AMQP::RabbitMQ::PP;
my $connection = Net::AMQP::RabbitMQ::PP->new();
$connection->connect;
$connection->basic_publish(
payload => "Foo",
routing_key => "foo.bar",
);
$connection->disconnect
# DESCRIPTION
Like [Net::RabbitMQ](https://metacpan.org/pod/Net%3A%3ARabbitMQ) but pure perl rather than a wrapper around librabbitmq.
# VERSION
0.11
# SUBROUTINES/METHODS
A list of methods with their default arguments (undef = no default)
## new
Loads the AMQP protocol definition, primarily. Will not be an active
connection until ->connect is called.
my $mq = Net::AMQP::RabbitMQ::PP->new;
## connect
Connect to the server. Default arguments are shown below:
$mq->connect(
host => "localhost",
port => 5672,
timeout => undef,
username => 'guest',
password => 'guest',
virtual_host => '/',
heartbeat => undef,
socket_timeout => 5,
frame_max => 131072,
);
connect can also take a secure flag for SSL connections, this will only work if
[IO::Socket::SSL](https://metacpan.org/pod/IO%3A%3ASocket%3A%3ASSL) is available. You can also pass SSL specific arguments through
in the connect method and these will be passed through
$mq->connect(
...
secure => 1,
SSL_blah_blah => 1,
);
## disconnect
Disconnects from the server
$mq->disconnect;
## set\_keepalive
Set a keep alive poller. Note: requires [Socket::Linux](https://metacpan.org/pod/Socket%3A%3ALinux)
$mq->set_keepalive(
idle => $secs, # time between last meaningful packet and first keep alive
count => $n, # number of failures to allow,
interval => $secs, # time between keep alives
);
## receive
Receive the nextframe
my $rv = $mq->receive;
Content or $rv will look something like:
{
payload => $str,
content_header_frame => Net::AMQP::Frame::Header,
delivery_frame => Net::AMQP::Frame::Method,
}
## channel\_open
Open the given channel:
$mq->channel_open( channel => undef );
## exchange\_declare
Instantiate an exchange with a previously opened channel:
$mq->exchange_declare(
channel => undef,
exchange => undef,
exchange_type => undef,
passive => undef,
durable => undef,
auto_delete => undef,
internal => undef,
alternate_exchange => undef,
);
## exchange\_delete
( run in 0.630 second using v1.01-cache-2.11-cpan-df04353d9ac )