-
Notifications
You must be signed in to change notification settings - Fork 18
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
queueMessage speed is too low #17
Comments
I'd better use flush() in every loop to prevent issues when app stops unexpectedly. If it would flush() after loop, it would send again and again email which have been sent already. 👎 |
You can catch exceptions and delay/remove the message which causes it from resending it. an option not to make SQL transaction after EVERY message would be a truly better way. Just try to send 1000 messages in one loop and check how much time the flushes consume in comparison with generating message content. no more comments would be needed. |
Run into the same problem. |
I've started a branch here but won't have time in the next few days to look at it in depth. It marks emails as |
@richsage sorry, but how this helps our problem? :) there is an obvious architecture issue when working with emails and DB. Handling failed emails is a different problem. When working with batch emails it is a blocker. |
If an email fails during the send process, your options would be:
The last option is what happens currently. The middle option is what I have started in my branch. @malas if you are able to open a PR with your suggested approach, I will happily review but at the moment I don't currently have capacity to work on this change. |
What if use DBAL instead of entities? It would give a better performance. |
@malas depends on flushing strategy:
The idea would be to avoid using EntityManager::flush() as it flushes all other entities, despite you want it or not 😕 |
You can change this behaviour thanks to #21 (although that's not in a release yet - if anyone needs it, do shout). |
In DatabaseSpool::queueMessage do not use
for every message as it drops down performance significantly. Flush should be called from the invoking code (externally):
The text was updated successfully, but these errors were encountered: