rabbitmq-tutorials/php
Michael Klishin 3262231aff
Update PHP tutorials README
After I had to go through them I believe some things
are worth clarifying ;)
2017-03-15 19:52:01 +03:00
..
.gitignore Ignore composer.phar 2017-03-15 19:30:47 +03:00
composer.json Update php-amqplib organization 2016-02-16 10:07:27 -08:00
emit_log_direct.php fix php notice if arg 1 not exist 2015-11-25 15:04:31 +07:00
emit_log_topic.php fix notice and empty check 2015-11-25 15:32:37 +07:00
emit_log.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
new_task.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
README.md Update PHP tutorials README 2017-03-15 19:52:01 +03:00
receive_logs_direct.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
receive_logs_topic.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
receive_logs.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
receive.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
rpc_client.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
rpc_server.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
send.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00
worker.php Updated demo code to use AMQPStreamConnection class instead of the deprecated AMQPConnection class. It has been officially deprecated since Nov. 2014, see: videlalvaro/php-amqplib@64eb289#diff-d22541aa1646efa4a61d570b8a0a0ff0. 2015-10-02 09:59:44 -05:00

PHP code for RabbitMQ tutorials

Here you can find PHP code examples from RabbitMQ tutorials.

To successfully use the examples you will need a running RabbitMQ server.

Requirements

PHP 5.3+

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

sudo apt-get install git-core php5-cli

Composer

Then install Composer per instructions on their site.

Client Library

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