8000 [Messenger] Collect all stamps added on Envelope by TimoBakx · Pull Request #10760 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Collect all stamps added on Envelope #10760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
7 changes: 6 additions & 1 deletion components/messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,14 @@ Hence you can inspect the envelope content and its stamps, or add any::
}

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

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

.. note::

Any stamp must be serializable using the Symfony Serializer component
Expand Down
0