No description, website, or topics provided.
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Add shared to the mapped supply so only evaluate once Jan 18, 2016
lib/Net Test tidy Nov 13, 2018
t Add test for #21 Dec 6, 2018
.gitignore Add a .gitignore with precomp artefacts Jan 15, 2016
Changes Up the version to 0.1.12 Dec 6, 2018
LICENSE Update years in LICENSE Jul 19, 2017
META6.json Up version to clean up tags Dec 6, 2018 Fill out the README Jul 19, 2017


Net::AMQP - a AMQP 0.9.1 client library (built and tested against RabbitMQ)


First start a consumer that will print the received messages:

use v6;

use Net::AMQP;

my $n =;

my $connection = $n.connect.result;

say 'connected';

my $channel = $;

say 'channel';

my $q = $channel.declare-queue('echo').result;

say 'queue';

    say 'Got message!';
    say $_.body.decode;
    if $_.body.decode eq 'exit' {
        $n.close("", "");

say 'set up';


say 'consuming';

await $connection;

Then run the script that will send a message sent on the command line,

use v6;

use Net::AMQP;

sub MAIN($message) {
    my $n =;

    await $n.connect;

    my $channel = $;

    $ => "echo", body => $message.encode);

    await $n.close("", "");


This is an async network library. Any -supply method returns a supply, and every other method will return a promise (with the exception of the initial call).



  • new

  • close

  • open-channel

  • connect


  • close

  • declare-exchange

  • exchange

  • declare-queue

  • queue

  • qos

  • flow

  • recover


  • delete

  • publish

  • return-supply


  • ack-supply



  • bind

  • unbind

  • purge

  • delete

  • consume

  • cancel


  • message-supply

  • recover



In order for this to work you will need to have access to an AMQP broker, the tests will, by default, use a broker on localhost with the default credentials. The tests will be skipped if no server is available,

Assuming you have a working installation of Rakudo Perl 6 then you will be able to install this with zef :

zef install Net::AMQP

# or if you have a local copy

zef install .