Skip to content
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

Handle failures and retries? #12

Open
ebeyrent opened this issue Jan 14, 2013 · 6 comments
Open

Handle failures and retries? #12

ebeyrent opened this issue Jan 14, 2013 · 6 comments

Comments

@ebeyrent
Copy link

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?

@videlalvaro
Copy link
Collaborator

Rejecting messages is not implemented in this library.

@bastnic
Copy link

bastnic commented Jan 17, 2013

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.

@ebeyrent
Copy link
Author

I'd like to be able to implement some sort of dead-letter queue if the callback returns false.

@ebeyrent
Copy link
Author

ebeyrent commented Feb 6, 2013

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

@videlalvaro
Copy link
Collaborator

cool stuff

@andrefigueira
Copy link

@videlalvaro would you recommend just extending the Thumper\Consumer and implementing our own processMessage method? seems like the most reasonable approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants