From e451527b8df884656fa93f75c4932f7517fddb65 Mon Sep 17 00:00:00 2001 From: Zach Bimson Date: Thu, 15 Feb 2024 17:38:55 +0000 Subject: [PATCH] Add default configuration for RabbitMQ Dependent on the rabbitmq module for Drupal. --- web/sites/default/settings.platformsh.php | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/web/sites/default/settings.platformsh.php b/web/sites/default/settings.platformsh.php index e80914a..8b88a40 100644 --- a/web/sites/default/settings.platformsh.php +++ b/web/sites/default/settings.platformsh.php @@ -92,6 +92,33 @@ ]; } +// Enable RabbitMQ configuration and default queue. +if ($platformsh->hasRelationship('rabbitmq') && class_exists(' Drupal\rabbitmq\Queue\Queue')) { + $rabbitmq = $platformsh->credentials('rabbitmq'); + + $settings['rabbitmq_credentials']['default'] = [ + 'host' => $rabbitmq['host'], + 'port' => $rabbitmq['port'], + 'vhost' => '/', + 'username' => $rabbitmq['username'], + 'password' => $rabbitmq['password'], + // Uncomment the lines below if you are using AMQP over SSL. + /* + 'ssl' => [ + 'verify_peer_name' => FALSE, + 'verify_peer' => FALSE, + 'local_pk' => '~/.ssh/id_rsa', + ], + */ + 'options' => [ + 'connection_timeout' => 5, + 'read_write_timeout' => 5, + ], + ]; + + $settings['queue_default'] = 'queue.rabbitmq.default'; +} + if ($platformsh->inRuntime()) { // Configure private and temporary file paths. if (!isset($settings['file_private_path'])) {