diff --git a/EventListener/SendFailedMessageToFailureTransportListener.php b/EventListener/SendFailedMessageToFailureTransportListener.php index dda97843..40b3fff2 100644 --- a/EventListener/SendFailedMessageToFailureTransportListener.php +++ b/EventListener/SendFailedMessageToFailureTransportListener.php @@ -49,6 +49,11 @@ public function onMessageFailed(WorkerMessageFailedEvent $event): void $envelope = $event->getEnvelope(); + // avoid re-sending to the failed sender + if (null !== $envelope->last(SentToFailureTransportStamp::class)) { + return; + } + $envelope = $envelope->with( new SentToFailureTransportStamp($event->getReceiverName()), new DelayStamp(0), diff --git a/Transport/Serialization/PhpSerializer.php b/Transport/Serialization/PhpSerializer.php index f9cd992c..438fc1a1 100644 --- a/Transport/Serialization/PhpSerializer.php +++ b/Transport/Serialization/PhpSerializer.php @@ -81,7 +81,7 @@ private function safelyUnserialize(string $contents): Envelope $prevUnserializeHandler = ini_set('unserialize_callback_func', self::class.'::handleUnserializeCallback'); } $prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) use (&$prevErrorHandler) { - if (__FILE__ === $file) { + if (__FILE__ === $file && !\in_array($type, [\E_DEPRECATED, \E_USER_DEPRECATED], true)) { throw new \ErrorException($msg, 0, $type, $file, $line); }