From e89348f44ab1306c5aa99df7e3919962f06527be Mon Sep 17 00:00:00 2001 From: Xnopyt Date: Tue, 3 Mar 2026 11:12:00 +0000 Subject: [PATCH] Fix compatibility with ElasticMQ --- CHANGELOG.md | 2 ++ src/AwsSqs/JobQueue.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 107901f..46e17ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Fixed +- Fix `Phlib\JobQueue\AwsSqs\JobQueue` throwing an exception when `JobQueue->retrieve()` is called on an empty queue and using an ElasticMQ server. ## [3.2.0] - 2025-11-11 ### Changed diff --git a/src/AwsSqs/JobQueue.php b/src/AwsSqs/JobQueue.php index f3d25a8..4f1eb65 100644 --- a/src/AwsSqs/JobQueue.php +++ b/src/AwsSqs/JobQueue.php @@ -104,7 +104,7 @@ public function retrieve(string $queue): ?JobInterface 'MaxNumberOfMessages' => 1, ]); - if (!isset($result['Messages'])) { + if (empty($result['Messages'])) { return null; }