Skip to content
Discussion options

You must be logged in to vote

I don't think Symfony Messenger has a built-in solution for this problem. You will have to implement a solution yourself. I would write a middleware that drops the second and every next message for the configured message types. If you run you PHP app in a fire and forget way (e.g. PHP-FPM) then you can just track the FQCN of the messages in your middleware and drop message if it is a duplicate. However if you run PHP app as long running process (CLI based solutions like PHP-PM or RoadRunner) then you can't just track already sent FQCNs because 2 messages of the same type might be coming from 2 different requests. In this case you will have do some request differentiating.

If your problem …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@NiklasBr
Comment options

@ghost
Comment options

Answer selected by lyrixx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant