rabbitmq-tutorials/php
2013-07-31 18:02:21 +02:00
..
.gitignore Add ignores for Composer artifacts 2013-07-29 21:07:36 +04:00
composer.json adds composer.json file 2013-07-29 16:30:04 +02:00
emit_log_direct.php Added php tutorials: Routing(four) and Topics(five) 2012-08-11 21:58:30 +02:00
emit_log_topic.php Added php tutorials: Routing(four) and Topics(five) 2012-08-11 21:58:30 +02:00
emit_log.php updates PHP files to use videlalvaro/php-amqplib 2013-07-29 16:31:05 +02:00
new_task.php updates PHP files to use videlalvaro/php-amqplib 2013-07-29 16:31:05 +02:00
README.md updates PHP README 2013-07-31 18:02:21 +02:00
receive_logs_direct.php Added php tutorials: Routing(four) and Topics(five) 2012-08-11 21:58:30 +02:00
receive_logs_topic.php Added php tutorials: Routing(four) and Topics(five) 2012-08-11 21:58:30 +02:00
receive_logs.php updates PHP files to use videlalvaro/php-amqplib 2013-07-29 16:31:05 +02:00
receive.php updates PHP files to use videlalvaro/php-amqplib 2013-07-29 16:31:05 +02:00
rpc_client.php fixes RPC client/server 2013-07-29 16:42:25 +02:00
rpc_server.php fixes RPC client/server 2013-07-29 16:42:25 +02:00
send.php updates PHP files to use videlalvaro/php-amqplib 2013-07-29 16:31:05 +02:00
worker.php updates PHP files to use videlalvaro/php-amqplib 2013-07-29 16:31:05 +02:00

PHP code for RabbitMQ tutorial

Here you can find a PHP code examples from RabbitMQ tutorials.

Requirements

To run the examples you need a running RabbitMQ server.

Additionally you need PHP 5.3 and php-amqplib. To get these dependencies on Ubuntu type:

sudo apt-get install git-core php5-cli

Then you can install php-amqplib using Composer.

To do that install Composer and add it to your path, then run the following command inside this project folder:

composer.phar install

Code

Tutorial one: "Hello World!":

php send.php
php receive.php

Tutorial two: Work Queues:

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

Tutorial three: Publish/Subscribe

php receive_logs.php
php emit_log.php "info: This is the log message"

Tutorial four: Routing:

php receive_logs_direct.php info
php emit_log_direct.php info "The message"

Tutorial five: Topics:

php receive_logs_topic.php "*.rabbit"
php emit_log_topic.php red.rabbit Hello

Tutorial six: RPC:

php rpc_server.php
php rpc_client.php