From d1340c5d077663673a919b12134aab5358b9eab1 Mon Sep 17 00:00:00 2001 From: Matei Stanca Date: Sat, 18 May 2024 19:00:54 -0400 Subject: [PATCH] Relates to #1: Replace deprecated AMQPConnection w/ AMQPStreamConnection --- src/AMQPLibConnector.php | 4 ++-- src/AbstractAMQPConnector.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AMQPLibConnector.php b/src/AMQPLibConnector.php index f61f7a3..cbd6701 100644 --- a/src/AMQPLibConnector.php +++ b/src/AMQPLibConnector.php @@ -67,7 +67,7 @@ class AMQPLibConnector extends AbstractAMQPConnector public function GetConnectionObject($details) { - return new \PhpAmqpLib\Connection\AMQPConnection( + return new \PhpAmqpLib\Connection\AMQPStreamConnection( $details['host'], $details['port'], $details['login'], @@ -129,7 +129,7 @@ public function Consume($msg) /** * Return result of task execution for $task_id - * @param \PhpAmqpLib\Connection\AMQPConnection $connection + * @param \PhpAmqpLib\Connection\AMQPStreamConnection $connection * @param string $task_id Celery task identifier * @param int $expire expire time result queue, milliseconds * @param boolean $removeMessageFromQueue whether to remove message from queue diff --git a/src/AbstractAMQPConnector.php b/src/AbstractAMQPConnector.php index 331f933..50e664a 100644 --- a/src/AbstractAMQPConnector.php +++ b/src/AbstractAMQPConnector.php @@ -53,7 +53,7 @@ public static function GetBestInstalledExtensionName($ssl = false) return 'php-amqplib-ssl'; } elseif (class_exists('\AMQPConnection') && extension_loaded('amqp')) { return 'pecl'; - } elseif (class_exists('\PhpAmqpLib\Connection\AMQPConnection')) { + } elseif (class_exists('\PhpAmqpLib\Connection\AMQPStreamConnection')) { return 'php-amqplib'; } else { return 'unknown';