Skip to content
RabbitMQ tutorials using Net::RabbitMQ
Perl
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
emit_log.pl
emit_log_direct.pl
emit_log_topic.pl
new_task.pl
receive.pl
receive_logs.pl
receive_logs_direct.pl
receive_logs_topic.pl
rpc_client.pl
rpc_server.pl
send.pl
worker.pl

README.md

RabbitMQ Tutorials - Perl

Ports of the Python RabbitMQ tutorials to Perl using Net::RabbitMQ.

Requirements

To successfully use the examples you will need a running RabbitMQ server. The scripts as written expect the RabbitMQ server to be on localhost, port 5672, guest/guest username/password. The mheiges/vagrant-rabbitmq Vagrant VM is one source of a suitable RabbitMQ for these tutorials.

The Perl scripts use Net::RabbitMQ. I use version 0.2.8 .

curl -LO http://www.cpan.org/authors/id/J/JE/JESUS/Net--RabbitMQ-0.2.8.tar.gz
tar zxf Net--RabbitMQ-0.2.8.tar.gz
cd Net--RabbitMQ-0.2.8
perl Makefile.PL
make
make install

Code

Tutorial one: "Hello World!":

perl send.pl
perl receive.pl

Tutorial two: Work Queues:

perl new_task.pl "A very hard task which takes two seconds.."
perl worker.pl

Tutorial three: Publish/Subscribe:

perl receive_logs.pl
perl emit_log.pl "info: This is the log message"

Tutorial four: Routing:

perl receive_logs_direct.pl info
perl emit_log_direct.pl info "The message"

Tutorial five: Topics:

perl receive_logs_topic.pl "*.rabbit"
perl emit_log_topic.pl red.rabbit Hello

Tutorial six: RPC:

perl rpc_server.pl
perl rpc_client.pl 10

The porting of Tutorial six differs a little from the Python original in that the Perl port accepts an optional value on the command line (default 30).

You can’t perform that action at this time.