diff --git a/src/Subscription/Engine/DefaultSubscriptionEngine.php b/src/Subscription/Engine/DefaultSubscriptionEngine.php index d419d7a44..6fafeb818 100644 --- a/src/Subscription/Engine/DefaultSubscriptionEngine.php +++ b/src/Subscription/Engine/DefaultSubscriptionEngine.php @@ -199,7 +199,7 @@ function (SubscriptionCollection $subscriptions) use ($limit): ProcessedResult { $messageCounter = 0; try { - $stream = $this->messageLoader->load($startIndex, $subscriptions); + $stream = $this->messageLoader->load($startIndex, $subscriptions->toArray()); foreach ($stream as $message) { $messageCounter++; @@ -370,7 +370,7 @@ function (SubscriptionCollection $subscriptions) use ($limit): ProcessedResult { $messageCounter = 0; try { - $stream = $this->messageLoader->load($startIndex, $subscriptions); + $stream = $this->messageLoader->load($startIndex, $subscriptions->toArray()); foreach ($stream as $message) { $messageCounter++; diff --git a/src/Subscription/Engine/SubscriptionCollection.php b/src/Subscription/Engine/SubscriptionCollection.php index f1ed60b55..a8fba233c 100644 --- a/src/Subscription/Engine/SubscriptionCollection.php +++ b/src/Subscription/Engine/SubscriptionCollection.php @@ -64,4 +64,10 @@ public function lowestPosition(): int return $min; } + + /** @return list */ + public function toArray(): array + { + return $this->subscriptions; + } }