Skip to content

Commit dd8b368

Browse files
committed
Reword the header regarding the envelope
1 parent 357fe25 commit dd8b368

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

components/messenger.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@ that will do the required processing for your message::
8989
}
9090
}
9191

92-
Envelope
93-
--------
92+
Adding Metadata to Messages (Envelopes)
93+
---------------------------------------
9494

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::
10099

101100
use Symfony\Component\Messenger\Envelope;
102101
use Symfony\Component\Messenger\Transport\Serialization\SerializerConfiguration;
@@ -129,8 +128,7 @@ marker, like this::
129128
public function handle($message, callable $next)
130129
{
131130
// $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.
134132

135133
if (null !== $message->get(ReceivedMessage::class)) {
136134
// Message just has been received...

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy