symfony-messenger
symfony-messenger copied to clipboard
Allow to stop retrying an SQS message
Hey there,
By browsing the code source around the SqsConsumer
and the SqsTransport
I could not find a way to "cancel" an event (delete it or send it to a dead letter queue).
Symfony messenger allow to throw an UnrecoverableMessageHandlingException
exception to stop to stop retrying a message. It could be nice to have this behaviour implemented in the bref SQS bridge.
What did you think?
I'm using SQS with symfony/messenger and have confirmed this issue, UnrecoverableMessageHandlingException
is not respected, messages are failing and being recalled over and over again.
The implementation uses the SQS transport provided by Symfony Amazon SQS Messenger, so all those features are supported. If you already use that transport, the transition to AWS Lamdba is very easy and should not require any change for dispatching messages.
https://github.com/brefphp/symfony-messenger/blob/master/README.md
At the very least the documentation should be updated to reflect this critical omission
Hi, that makes sense indeed. @kieljohn you are welcome to implement the feature, or at least send a PR to update the documentation?
Hello! I am observing the same behaviour thant @kieljohn is mentioning. It is resolved in the version 0.4 that uses the Symfony official implementation?
@terox the issue is still open.
@terox I'm currently experimenting with https://packagist.org/packages/happyr/bref-messenger-failure-strategies in conjunction with this library. I don't however feel it would be appropriate to issue a PR with the docs suggesting they need another package to effectively ensure that failures are tolerated properly. I see it as a critical omission in this library.
However that said, a colleague has said he may take a look at this depending on his time constraints in the coming weeks, but this is OSS so documented issues and workarounds are the best I can give at the moment.
I will try to take a look because I am not using that library but I am experimenting that behaviour. Messages that are sent again, and again, and again. It could be and issue by my side, but I observed it after update to "serverless" with bref.
I suggested the 0.4 because that PR was merged recently: https://github.com/brefphp/symfony-messenger/pull/38 and I didn't know if it could be related to an SQS implementation. But, after @mnapoli and you @kieljohn I understand that maybe the issue is more deep.
Definitively it need a deep review. I will try to get some extra time to check it also.
Thank you
@kieljohn Im using that package from happyr and it works as expected. The UnrecoverableMessageHandlingException
is not retried and directly send to the failed transport, which I configured to mysql for persistent storage. (I only use the SQS DeadLetterQueue for infrastructure errors, eg lambda timeouts)
@terox you could try/catch the UnrecoverableMessageHandlingException
and allow it to silently continue?
https://github.com/brefphp/symfony-messenger/blob/master/src/Service/SimpleBusDriver.php#L24 or https://github.com/brefphp/symfony-messenger/blob/master/src/Service/Sqs/SqsConsumer.php#L58