What Is Rabbit MQ
What Is Rabbit MQ
• Producer in Magento sends the order ID and other relevant information to a queue
• Consumer pulls messages from that queue and generates the appropriate PDFs
The single-threaded nature of consumers means that only one PDF at a time will be generated, and in the order that the
request was received. This can be used for converting quotes to orders, zipping large data files, generating images, etc
Distributed Data Processing
RMQ consumers are single-threaded and can only process one message at a time.
To scale up:
• Multiple consumers can access the same queue
• Depending on server resources, many consumers can be spawned to handle the same processes
Options for Consumers
Run on a schedule
• Cron is used to trigger the consumer on a schedule
• Consumer can consume all messages in the queue, or be set to keep running until a limit is reached
Run continuously
• Supervisor is used to start the consumers and ensure they keep running
• Consumers are set to keep running until they consume a certain number of messages
• Once the limit is reached, the consumer stops and supervisor restarts it
Resources
RabbitMQ beginner’s guide:
https://www.cloudamqp.com/blog/2015-05-18-part1-rabbitmq-for-
beginners-what-is-rabbitmq.html
CloudAMQP Documentation
https://www.cloudamqp.com/docs/index.html