-
This might be a lack of comprehension from the docs, but I'm trying to understand what the pattern for dead letter handling is in river. My understanding is that if a job is an error state that it is eventually cancelled after exhausting retries. Once a job is cancelled it will eventually be cleaned from the database. What's the preferred pattern for moving the jobs to the side on error and then explicitly queuing again? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @ewhauser! After a job has run out of attempts, it is moved to the discarded state. This means no further attempts will be performed on that job. It will also be pruned from the jobs table after the You have the opportunity to take an action when the job errors for a final time using an error handler, or you can write your own logic to periodically look for discarded jobs and then alert you or whatever you’d like to do in response to those. Let me know if you have any ideas on how this could be made clearer in the docs! One thing I know we’re missing is higher level stuff like just describing all the different job states, and the general flow that jobs go through during their lifetime. |
Beta Was this translation helpful? Give feedback.
-
Yes, this does make sense. Can the error handler participate in the transaction? i.e. if you insert the I do think dead letter queue functionality is pretty standard functionality for queue systems. Would there be openness for feature request for this? |
Beta Was this translation helpful? Give feedback.
Hi @ewhauser! After a job has run out of attempts, it is moved to the discarded state. This means no further attempts will be performed on that job. It will also be pruned from the jobs table after the
DiscardedJobRetentionPeriod
has elapsed.You have the opportunity to take an action when the job errors for a final time using an error handler, or you can write your own logic to periodically look for discarded jobs and then alert you or whatever you’d like to do in response to those.
Let me know if you have any ideas on how this could be made clearer in the docs! One thing I know we’re missing is higher level stuff like just describing all the different job states, and the general flow th…