-- Ryan Lange <[email protected]> wrote (on Thursday, 05 August 2010, 10:42 AM -0400): > I'm using Zend_Queue (Db adapter, specifically) to store emails that are > generated by a front-end script to be processed by a back-end script (via > cron). Nothing out of the ordinary, really. > > The problem is that these emails can fail for any number of reasons (the user > entering information on the front-end script may typo their email address; the > recipient's email address may no longer be valid; etc.). These errors are > logged so that they can be investigated by a human, but I'd like for the queue > to just "give up" on the problematic email after a few tries. > > Unfortunately, there's doesn't seem to be a built-in mechanism for keeping > track of the number of times a specific message has been receive()d. Does > anyone have any tips on how to handle this situation?
In previous systems I used (ones that predate Zend_Queue), what we did was to ad some logic to the handler. If it failed, it requeued the job, but also added some metadata indicating failure count. If the failure count exceeded a specific threshold, we logged a failure message with the job details, and didn't re-queue. Note that this was logic we built into our handler -- it's definitely not built into Zend_Queue at this time. -- Matthew Weier O'Phinney Project Lead | [email protected] Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc
