Net-RabbitMQ-Simple is a project mainly written in Perl, it's free.
=head1 NAME
Net::RabbitMQ::Simple - A simple syntax for Net::RabbitMQ
=head1 SYNOPSIS
use Net::RabbitMQ::Simple;
mqconnect {
hostname => 'localhost',
user => 'guest',
password => 'guest',
vhost => '/'
};
exchange {
name => 'mtest_x',
type => 'direct',
passive => 0,
durable => 1,
auto_delete => 0,
exclusive => 0
};
publish {
exchange => 'maketest',
queue => 'mtest',
route => 'mtest_route',
message => 'message',
options => { content_type => 'text/plain' }
};
my $rv = consume;
# or
# my $rv = get { options => { routing_key => 'foo.*' }}
# use Data::Dumper;
# print Dumper($rv);
mqdisconnect;
=head1 DESCRIPTION
This package implements a simple syntax on top of L
=head1 METHODS
=cut
=head2 mqconnect %hash
Connect to AMQP server using librabbitmq.
Return L
{
user => 'guest'
password => 'guest',
vhost => '/',
channel_max => 0,
frame_max => 131072,
heartbeat => 0
}
=cut
=head2 exchange %hash
Declare an exchange for work.
{
name => 'name_of_exchange',
exchange_type => 'direct',
passive => 0,
durable => 0,
auto_delete => 1
}
=cut
=head2 exchange_delete %hash
Delete an exchange if is possible.
exchange_delete {
name => 'name_of_exchange',
if_unused => 1,
nowait => 0
}
=cut
=head2 exchange_publish %hash
Publish a new message.
{
exchange => 'exchange',
queue => 'queue',
route => 'route',
message => 'message',
options => { content_type => 'text/plain' }
}
=cut
=head2 consume %hash
Consume messages from queue.
{
queue => 'name'
}
=cut
=head2 get %hash
Consume messages from queue, but return undef if doesn't have message.
{
queue => 'queue',
options => { routing_key => 'foo' }
}
=cut
=head2 tx
Start a server-side transaction over channel.
=cut
=head2 commit
Commit a server-side transaction over channel.
=cut
=head2 rollback
Rollback a server-side transaction over channel.
=cut
=head2 purge
Purge queue.
=cut
=head2 ack
Need acknowledged.
=cut
=head2 mqdisconnect
Disconnect from server.
=cut
=head2 mqobject $object
Set current L
=cut
=head1 SUPPORT
=over 4
=item * RT: CPAN's request tracker
Lhttp://rt.cpan.org/tbr/Bugs.html?Dist=Net-RabbitMQ-Simple
=item * AnnoCPAN: Annotated CPAN documentation
Lhttp://annocpan.org/dist/Net-RabbitMQ-Simple
=item * CPAN Ratings
Lhttp://cpanratings.perl.org/d/Net-RabbitMQ-Simple
=item * Search CPAN
Lhttp://search.cpan.org/dist/Net-RabbitMQ-Simple
=back
=head1 SEE ALSO
L
=head1 AUTHOR
Thiago Rondon. [email protected]
=head1 LICENSE AND COPYRIGHT
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See L
=cut