Here you can find PHP code examples from RabbitMQ tutorials.
To successfully use the examples you will need a running RabbitMQ server.
You need PHP 5.3
and php-amqplib
. To get these
dependencies on Ubuntu type:
sudo apt-get install git-core php5-cli
Then install Composer per instructions on their site.
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
Or you can require it to the existing project using a command:
composer.phar require php-amqplib/php-amqplib
php send.php
php receive.php
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"
php receive_logs_direct.php info
php emit_log_direct.php info "The message"
php receive_logs_topic.php "*.rabbit"
php emit_log_topic.php red.rabbit Hello
php rpc_server.php
php rpc_client.php
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。