Module Description
This modules provides RabbitMQ integration with Drupal's queuing system. The module requires the php-amqplib library to run.
Drupal 8 & 9 The Drupal 8 module uses the Queue API to declare and send data to a queue, and it's primary focus is to allow developers to integrate data submission with RabbitMQ.
Queues and exchanges are both supported.
When configured via rabbitmq.config.yml (see the example module), sending data to the queue is as easy as
// Some data to send off to the queue $data = ['apples', 'oranges']; // Get the queue config $queue_factory = \Drupal::service('queue'); $queue = $queue_factory->get('example_queue'); // Send data to the queue $queue->createItem($data); Example module
To test RabbitMQ from your Drupal site, enable the rabbitmq_example module and following the instructions from the README.
Drush integration
To test RabbitMQ, the module provides a list of Drush commands to help out with queue processing and queue information.
Version Matrix Version Core Drush 3.x ^9 10,11 8.x-2.x >=8.7.7 8,9,10 8.x-1.x <=8.8.3 8 Drupal 7 The Drupal RabbitMQ modules requires the php-amqplib library to run. Download the source code from https://github.com/videlalvaro/php-amqplib/tree/v1.0 Extract the source at either sites/all/modules/rabbitmq/php-amqplib or sites/all/libraries/php-amqplib. Rabbit will otherwise fail if it can't find the libraries it needs.
You'll need provide connection credentials in the form of an array using either Drupal's $conf global variable in settings.php or using variable_set(). E.g.
Option 1. Define in settings.php.
global $conf; $conf['rabbitmq_credentials'] = array( 'host' => 'localhost', 'port' => 5672, 'username' => 'guest', 'password' => 'guest', ); Option 2. Manually set one time with variable_set().
variable_set('rabbitmq_credentials', array( 'host' => 'localhost', 'port' => 5672, 'username' => 'guest', 'password' => 'guest', )); Set RabbitMQ as the queing system for the queues you want RabbitMQ to maintain:
// Set all queues to use RabbitMQ variable_set('queue_default_class', 'RabbitMQQueue'); or
// Set a specific queue. variable_set('queue_class_<queue_name>', 'RabbitMQQueue'); Credits Originally developed by Josh Waihi for Drupal 7 and fgm for the initial Drupal 8 port. Please help out so this module becomes the standard for integration with the Rabbit MQ service.
Drupal 8 & 9 The Drupal 8 module uses the Queue API to declare and send data to a queue, and it's primary focus is to allow developers to integrate data submission with RabbitMQ.
Queues and exchanges are both supported.
When configured via rabbitmq.config.yml (see the example module), sending data to the queue is as easy as
// Some data to send off to the queue $data = ['apples', 'oranges']; // Get the queue config $queue_factory = \Drupal::service('queue'); $queue = $queue_factory->get('example_queue'); // Send data to the queue $queue->createItem($data); Example module
To test RabbitMQ from your Drupal site, enable the rabbitmq_example module and following the instructions from the README.
Drush integration
To test RabbitMQ, the module provides a list of Drush commands to help out with queue processing and queue information.
Version Matrix Version Core Drush 3.x ^9 10,11 8.x-2.x >=8.7.7 8,9,10 8.x-1.x <=8.8.3 8 Drupal 7 The Drupal RabbitMQ modules requires the php-amqplib library to run. Download the source code from https://github.com/videlalvaro/php-amqplib/tree/v1.0 Extract the source at either sites/all/modules/rabbitmq/php-amqplib or sites/all/libraries/php-amqplib. Rabbit will otherwise fail if it can't find the libraries it needs.
You'll need provide connection credentials in the form of an array using either Drupal's $conf global variable in settings.php or using variable_set(). E.g.
Option 1. Define in settings.php.
global $conf; $conf['rabbitmq_credentials'] = array( 'host' => 'localhost', 'port' => 5672, 'username' => 'guest', 'password' => 'guest', ); Option 2. Manually set one time with variable_set().
variable_set('rabbitmq_credentials', array( 'host' => 'localhost', 'port' => 5672, 'username' => 'guest', 'password' => 'guest', )); Set RabbitMQ as the queing system for the queues you want RabbitMQ to maintain:
// Set all queues to use RabbitMQ variable_set('queue_default_class', 'RabbitMQQueue'); or
// Set a specific queue. variable_set('queue_class_<queue_name>', 'RabbitMQQueue'); Credits Originally developed by Josh Waihi for Drupal 7 and fgm for the initial Drupal 8 port. Please help out so this module becomes the standard for integration with the Rabbit MQ service.
Module Link
Project Usage
130
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module aims to provide RabbitMQ integration with Drupal's queuing system, allowing developers to easily send data to a queue using the Queue API.
Data Name
rabbitmq