URI::amqp - AMQP (RabbitMQ) URI
my $uri = URI->new('amqp://user:pass@host.domain:1234/'); my $ar = AnyEvent::RabbitMQ->new->load_xml_spec()->connect( host => $uri->host, port => $uri->port, user => $uri->user, pass => $uri->password, vhost => $uri->vhost, tls => $uri->secure, heartbeat => scalar $uri->query_param('heartbeat'), ... );
URI extension for AMQP protocol (https://www.rabbitmq.com/uri-spec.html)
vhost is path part of URI
slash / on start is removed (this is different with path method)
/
path
return undef if vhost not defined (should be used default of module which use this URI module)
undef
return query parameters (https://www.rabbitmq.com/uri-query-parameters.html)
implement by URI::QueryParam module
return tuplet of ($host, $options) which works with Net::AMQP::RabbitMQ connect method
($host, $options)
connect
use URI; use Net::AMQP::RabbitMQ; my $uri = URI->new('amqp://guest:guest@localhost'); my $mq = Net::AMQP::RabbitMQ->new(); $mq->connect($uri->as_net_amqp_rabbitmq_options);
return options which works with AnyEvent::RabbitMQ connect method
use URI; use AnyEvent::RabbitMQ; my $cv = AnyEvent->condvar; my $uri = URI->new('amqp://user:pass@host.domain:1234/'); my $ar = AnyEvent::RabbitMQ->new->load_xml_spec()->connect( $uri->as_anyevent_rabbitmq(), on_success => sub { ... }, ... );
module doesn't support correct canonpath (reverse) method (yet)
canonpath
Copyright (C) Avast Software.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Jan Seidl <seidl@avast.com>
To install URI::amqp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm URI::amqp
CPAN shell
perl -MCPAN -e shell install URI::amqp
For more information on module installation, please visit the detailed CPAN module installation guide.