Skip to content

Files

Latest commit

1f0dde6 · Nov 27, 2013

History

History
This branch is 1102 commits behind rabbitmq/rabbitmq-tutorials:main.

php

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jul 29, 2013
Oct 20, 2013
Jul 29, 2013
Jul 29, 2013
Jul 31, 2013
Jul 31, 2013
Jul 29, 2013
Jul 29, 2013
Jul 29, 2013
Nov 27, 2013
Jul 31, 2013
Jul 29, 2013
Jul 29, 2013
Jul 29, 2013
Jul 29, 2013

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

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