graze / queue

:postbox: Flexible abstraction for working with queues in PHP.
MIT License
49 stars 10 forks source link

Handle individual message handling failures without failing a batch #23

Closed h-bragg closed 8 years ago

h-bragg commented 8 years ago

Currently when grabbing messages from the queue, if any of the messages fail, all messages after that will be marked as having failed / increased its retry count.

It would be nice to have:

Thoughts?

sjparkinson commented 8 years ago

So we're going to look at updating the three concrete handlers to check if $result is strictly equal to false and skip acknowledgment if that's the case.

h-bragg commented 8 years ago

:+1:

sjparkinson commented 8 years ago

So, checkout https://github.com/graze/queue/commit/38c030fdacb01d898f52158e1a98aa7f0881ea4e.

I'm not sure this is a great practice though, will it not mean if workers are all going to skip acknowledgment of a bad message then that message will continue to get dequeued until the end of time?

I'm actually really leaning towards asking you to implement your own handler for this specific case.