Thumper
Thumper copied to clipboard
Handle failures and retries?
I can't see a way in this library to reject a message in the callback upon some error condition so that RabbitMQ will retry the message.
Am I missing something, or should I be using php-amqplib instead?
Rejecting messages is not implemented in this library.
The ack message is actually sent by the Consumer class right after call_user_func so there is no proper way for a callback to reject or nack the message expect throw an ugly exception.
Solution can be to pass the $msg->delivery_info to the callback action and:
- let it do the ack / nack / reject
- do an ack call in Consumer if the callback hasn't send anything.
I'd like to be able to implement some sort of dead-letter queue if the callback returns false.
I've created a new PHP library called Mopsy, loosely based on Thumper. It provides functionality for retrying failed messaged based on a configurable threshold, and beyond that republishes the message to a dead-letter exchange.
https://github.com/ebeyrent/Mopsy
cool stuff
@videlalvaro would you recommend just extending the Thumper\Consumer
and implementing our own processMessage
method? seems like the most reasonable approach?