
Fixed a few spelling errors. Removed unnecessary timeout argument from some connections. Removed on_return callback from send.pl. Modified rpc_client to allow parameter passing. Added autoflush, $|++, to allow for automated testing.
1.6 KiB
1.6 KiB
Perl code for RabbitMQ tutorials
Here you can find Perl code examples from RabbitMQ tutorials.
To successfully use the examples you will need a running RabbitMQ server.
Requirements
To run this code you need to install Net::RabbitFoot.
cpan -i Net::RabbitFoot
For tutorial six UUID::Tiny needs to be installed.
cpan -i UUID::Tiny
On Ubuntu:
sudo apt-get install make libclass-data-inheritable-perl libtest-deep-perl libmoosex-app-cmd-perl libcoro-perl libjson-xs-perl libxml-libxml-perl libconfig-any-perl libmoosex-attributehelpers-perl libmoosex-configfromfile-perl libtest-exception-perl libfile-sharedir-perl libreadonly-xs-perl libuuid-tiny-perl
sudo cpan -i Net::RabbitFoot
Code
perl send.pl
perl receive.pl
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"
perl receive_logs_direct.pl info
perl emit_log_direct.pl info "The message"
perl receive_logs_topic.pl "*.rabbit"
perl emit_log_topic.pl red.rabbit Hello
perl rpc_server.pl
perl rpc_client.pl