Skip to content

Commit 7165445

Browse files
committed
[Messenger] Collect all stamps added on Envelope
1 parent f22904d commit 7165445

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

components/messenger.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,14 @@ Hence you can inspect the envelope content and its stamps, or add any::
175175
}
176176

177177
The above example will forward the message to the next middleware with an additional
178-
stamp *if* the message has just been received (i.e. has the `ReceivedStamp` stamp).
178+
stamp *if* the message has just been received (i.e. has at least 1 `ReceivedStamp` stamp).
179179
You can create your own stamps by implementing :class:`Symfony\\Component\\Messenger\\Stamp\\StampInterface`.
180180

181+
If you want to examine all stamps on an envelope, you can call ``$envelope->all()``.
182+
This will return all stamps, grouped by type (FQCN). Alternatively, you can
183+
iterate through all stamps of a specific type by using the FQCN as first parameter
184+
of this method, for example ``$envelope->all(ReceivedStamp::class)``.
185+
181186
.. note::
182187

183188
Any stamp must be serializable using the Symfony Serializer component

0 commit comments

Comments
 (0)