office365-mail
office365-mail copied to clipboard
Rate limiting / throttling
Is there a way to implement rate limiting / throttling on the number of mails sent per second? The Symphony AbstractTransport class has a setMaxPerSecond
method which sets a rate
public property, but I don't think that would have any impact here.
I'm running into a problem where emails are failing with:
503 Service Unavailable response:
{"error":
{"code":"ResourceUnhealthy","message":"MdbReplicationProtectionUtilizationMonitor is unhealthy."}
}
I've contacted Microsoft support and they tell me this is due to sending too many requests, essentially the same as a 429 error.
Microsoft provides some info on how to handle this here: Best Practices essentially using the Retry-After
header, but I don't know if this is something that can be implemented with this mail driver.
Any advice is much appreciated.
Maybe you can prevent this by using schedules?
Thanks. I'd forgotten about this issue. It's easily solved by using Laravel's built in queue throttling options.