getMessage(); if ($envelope->all(ReceivedStamp::class) && $message instanceof LockableMessage) { $lock = $this->lockFactory->createLock($this->objectHash($message), null); if (!$lock->acquire()) { return $envelope; } try { return $stack->next()->handle($envelope, $stack); } catch (Throwable $exception) { throw $exception; } finally { $lock->release(); } } return $stack->next()->handle($envelope, $stack); } private function objectHash(LockableMessage $message): string { return hash('crc32', serialize($message)); } }