8000 [Messenger] Stamps as Attributes on message class · Issue #50800 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Stamps as Attributes on message class #50800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers 8000 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

Open
KerianMM opened this issue Jun 28, 2023 · 1 comment · May be fixed by #50812
Open

[Messenger] Stamps as Attributes on message class #50800

KerianMM opened this issue Jun 28, 2023 · 1 comment · May be fixed by #50812

Comments

@KerianMM
Copy link
Contributor

Description

Some of my messages always have the same stamps in the dispatch, I'd like to reduce this code by adding one or more attributes to my message.

The envelope constructor could read the stamps assigned to the message

Example

No response

@derrabus
Copy link
Member

Some of my messages always have the same stamps in the dispatch

Have you tried building a middleware for that?

The envelope constructor could read the stamps assigned to the message

I'd rather keep the envelope dumb tbh. So, a 👎🏻 from me for stuffing that logic into the envelope class.

I'd like to reduce this code by adding one or more attributes to my message.

You could build a middleware that reads those attributes. The advantage of that approach would be that this feature could be turned off easily. When dispatching a lot of messages, I probably don't want messenger to reflect on each of them.

507A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0