An example which demonstrates Consumer(server)/Publisher(client) integration to RabbitMQ
- RabbitMQ Server : To handle our queue
- py-amqplib : Python libraries for AMQP
- simplejson : Python library to encode/decode JSON data
- php-amqplib : PHP library for AMQP
- consumer/consumer.py : A simple consumer, which listens RabbitMQ messages and simulates a mail queue
- publisher/publisher.py : A simple consumer, which listens RabbitMQ messages and simulates a mail queue
- publisher/publisher.php : A simple consumer, which listens RabbitMQ messages and simulates a mail queue
Ensure that you installed and started RabbitMQ server, py-amqplib, simplejson and php-amqplib
First you need to run your consumer which will simulate a mail sender
cd consumer && python consumer.py
After then you can send messages with one your publisher
cd publisher && python publisher.py
cd publisher && php publisher.php or run this PHP code from your web server