-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Make RoundRobinTransport retryPeriod configurable #52551
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
Comments
If we want to support it in DSN, we should probably edit symfony/src/Symfony/Component/Mailer/Transport.php Lines 107 to 152 in b004c3c
Is there any RFC/good practice for good syntax ? |
@alamirault Yes, this method would have to be updated. About the good practice, I think that this should be done in a standard way, i.e. option are added as after the question mark ( |
This issue is a duplicate of #50981. |
closing in favour of #50981 then< A8C2 /p> |
… (Sébastien Despont, fabpot) This PR was merged into the 7.3 branch. Discussion ---------- [Mailer] Add `retry_period` option for email transport | Q | A | ------------- | --- | Branch? | 7.2 | Bug fix? | no | New feature? | yes | Deprecations? | no | Issues | Fix #50981 #52551 | License | MIT RoundRobinTransport constructor has retryPeriod set to 60 seconds. This cannot be configured right now. Let's say all the transports fail (e.g. email address with domain that does not exist). Problems: 1. When sending more than one email synchronously we can't send emails following the one that failed. We have to sleep(x) where x >= 60sec. (of course we have to handle the TransportException thrown by invalid email but this is another topic) 2. When using Messenger and async emails we don't have to worry about handling TransportException because invalid message will be sent back to the queue however the worker cannot consume another messages for the next 60 seconds. Also logs will be flooded with exceptions because in this 60s window a lot of messages could be tried. This PR permits to specify a retry period using a new DNS option `retry_period` like `MAILER_DSN="roundrobin(postmark+api://ID@default sendgrid+smtp://KEY@default)?retry_period=15"` Commits ------- 9716a89 Simplify code c5703ae Add retry_period option for email transport
Description
RoundRobinTransport constructor has
retryPeriod
set to 60 seconds. This cannot be configured right now.Let's say all the transports fail (e.g. email address with domain that does not exist).
Problems:
sleep(x)
where x >= 60sec. (of course we have to handle the TransportException thrown by invalid email but this is another topic)Example
No response
The text was updated successfully, but these errors were encountered: