@@ -89,14 +89,13 @@ that will do the required processing for your message::
89
89
}
90
90
}
91
91
92
- Envelope
93
- --------
92
+ Adding Metadata to Messages (Envelopes)
93
+ ---------------------------------------
94
94
95
- The notion of an envelope is a concept that helps add context around the
96
- messages. An envelope is a message and a set of data. From a user's perspective, this
97
- allows you to set some configuration around the message. For example, to set the serialization
98
- groups used when the message goes through the transport layer, wrap your message
99
- in an ``Envelope `` and add some ``SerializerConfiguration ``::
95
+ If you need to add metadata or some configuration to a message, wrap it with the
96
+ :class: `Symfony\\ Component\\ Messenger\\ Envelope ` class. For example, to set the
97
+ serialization groups used when the message goes through the transport layer, use
98
+ the ``SerializerConfiguration `` envelope::
100
99
101
100
use Symfony\Component\Messenger\Envelope;
102
101
use Symfony\Component\Messenger\Transport\Serialization\SerializerConfiguration;
@@ -129,8 +128,7 @@ marker, like this::
129
128
public function handle($message, callable $next)
130
129
{
131
130
// $message here is an `Envelope` object, because this middleware
132
- // implements the EnvelopeAwareInterface interface. Otherwise,
133
- // it would be the "original" message.
131
+ // implements the EnvelopeAwareInterface interface.
134
132
135
133
if (null !== $message->get(ReceivedMessage::class)) {
136
134
// Message just has been received...
0 commit comments