Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

Commit

Permalink
Exclude non sendable stamps
Browse files Browse the repository at this point in the history
  • Loading branch information
kunicmarko20 committed Jul 7, 2019
1 parent 3bcf81b commit 1d9e0ca
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use KunicMarko\JMSMessengerAdapter\Stamp\DeserializationContextStamp;
use KunicMarko\JMSMessengerAdapter\Stamp\SerializationContextStamp;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\NonSendableStampInterface;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use JMS\Serializer\SerializerInterface as JMSSerializerInterface;

Expand Down Expand Up @@ -94,6 +95,8 @@ public function encode(Envelope $envelope): array
$context = $serializerStamp->getContext();
}

$envelope = $envelope->withoutStampsOfType(NonSendableStampInterface::class);

$headers = ['type' => \get_class($envelope->getMessage())] + $this->encodeStamps($envelope);

return [
Expand Down

0 comments on commit 1d9e0ca

Please sign in to comment.