RabbitMQ starter kit
To start any of the scripts included you need to check first that you have a rabbitMQ server running on localhost.
The project tree contains at the top level:
the message producer, a script that publishes messages on the 'jobs' queue
a system_command script, that publishes the argument passed on the 'system' queue
a heartbeat_monitor script that collects the messages on the heartbeat queue and polls the 'jobs' queue status
The rest of project is divided into directories; every directory includes one or more consumer scripts.
Multiple consumers and producers can be active at the same time
You need to have
amqp gem version 0.6.4 or later
rabbitMQ server version 1.6.0 or later
After installing the software listed in the requirements, run
Open a console on your system, and from the top directory of this repository execute
this will start the producer script that will start publishing messages on the queue.
After that open another console and always from the top directory of this repository execute
This script will start printing out the number of messages in the queue.
At this point you can open another console and start any of the consumers contained in the numbered directories. As an example try executing
The consumer will start printing out the messages coming from the queue.
Do experiment trying to start multiple consumers or one by one in turn and observe how the heartbeat_monitor.rb output reacts to the number and types of consumer that are active at a given time.