Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jasei/uri-amqp
perl module URI::amqp
https://github.com/jasei/uri-amqp
amqp module perl rabbitmq uri
Last synced: 1 day ago
JSON representation
perl module URI::amqp
- Host: GitHub
- URL: https://github.com/jasei/uri-amqp
- Owner: JaSei
- License: other
- Created: 2017-05-18T22:32:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-08T16:33:11.000Z (over 7 years ago)
- Last Synced: 2024-11-06T02:50:00.834Z (about 2 months ago)
- Topics: amqp, module, perl, rabbitmq, uri
- Language: Perl
- Size: 23.4 KB
- Stars: 0
- Watchers: 21
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/avast/URI-amqp.svg?branch=master)](https://travis-ci.org/avast/URI-amqp)
# NAMEURI::amqp - AMQP (RabbitMQ) URI
# SYNOPSIS
my $uri = URI->new('amqp://user:[email protected]: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'),
...
);# DESCRIPTION
URI extension for AMQP protocol ([https://www.rabbitmq.com/uri-spec.html](https://www.rabbitmq.com/uri-spec.html))
# EXTENDED METHODS
## vhost
vhost is path part of URI
slash `/` on start is removed (this is different with `path` method)
return `undef` if vhost not defined (should be used default of module which use this URI module)
## query\_param
return query parameters ([https://www.rabbitmq.com/uri-query-parameters.html](https://www.rabbitmq.com/uri-query-parameters.html))
implement by [URI::QueryParam](https://metacpan.org/pod/URI::QueryParam) module
## as\_net\_amqp\_rabbitmq
return tuplet of `($host, $options)` which works with [Net::AMQP::RabbitMQ](https://metacpan.org/pod/Net::AMQP::RabbitMQ) `connect` method
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);## as\_anyevent\_rabbitmq
return options which works with [AnyEvent::RabbitMQ](https://metacpan.org/pod/AnyEvent::RabbitMQ) `connect` method
use URI;
use AnyEvent::RabbitMQ;my $cv = AnyEvent->condvar;
my $uri = URI->new('amqp://user:[email protected]:1234/');
my $ar = AnyEvent::RabbitMQ->new->load_xml_spec()->connect(
$uri->as_anyevent_rabbitmq(),
on_success => sub {
...
},
...
);# LIMITATIONS
module doesn't support correct `canonpath` (reverse) method (yet)
# LICENSE
Copyright (C) Avast Software.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.# AUTHOR
Jan Seidl