ricbra / rabbitmq-cli-consumer

Consume RabbitMQ messages into any cli program
MIT License
247 stars 49 forks source link

Support NACKs without requeing (v2.x) #39

Open gaspaio opened 8 years ago

gaspaio commented 8 years ago

I see that the handling of custom exit codes from the executed command hasn't been implemented in branch 2.0. Why ?

I'm a heavy user of the NACK with requeue=false option. Is this something you're thinking of re-implementing in 2.0 version or dropping altogether ?

gaspaio commented 8 years ago

Also, if you're thinking of re-implementing this (or open to PRs on this issue), it would be great to define via config a default behaviour when the consumer receives an unexpected exit code from the command.

The use-case for this is simple and very important: when the command crashes due to a bad message, i want the worker to be able to send the bad message to the deadLetter xchange instead of just crashing and requeing the bad message. A monitored (and auto-restarted) worker will enter an infinite cycle of if a such bad message comes along. Defining a default behaviour for unexpected exit-codes allows us to avoid this I think.

ricbra commented 8 years ago

The 2.0 is still under development. This is certainly something that will come in before release, no worries. I'm also using this particular function ;) Also the default behaviour you're mentioning is something I want to get in.

Now, the only problem is the spare time I have. I'm very busy with work for clients so it's hard to find the time during workdays. Also, some PRs have been merged in the v1 version so it will take some time to get everything aligned again. I'm aiming at a release before 2017 though.