AMQP::Subscriber -- Listens for messages on a queue and does stuff with them.
use AMQP::Subscriber; my $subscriber = AMQP::Subscriber->new; $subscriber->server('amqp://foo:bar@localhost:5672/testing'); $subscriber->exchange('test'); $subscriber->type('topic'); $subscriber->queue('testing'); $subscriber->callback( sub { my ($self,$message) = @_; say $message; }); $subscriber->attach;
The AMQP::Subscriber wraps
new( \%params ) (constructor)
Create a new instance of this class. Initialize the object with whatever is in \%params, which are not predefined.</p>
\%params
Returns: new instance of this class.
server($url)
Configures all of the connection settings based on an AMQP url. The format of which is:
amqp://username:password@host:port/vhost
All of the elements of the url are required if you are not using the defaults. The default settings are:
amqp://guest:guest@localhost:5672/
attach()
If you find them out
Same as Perl.
Dave Goehrig <dave@dloh.org>
To install AMQP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AMQP
CPAN shell
perl -MCPAN -e shell install AMQP
For more information on module installation, please visit the detailed CPAN module installation guide.