[erlang-questions] RabbitMQ message consumption
Jesper Louis Andersen
Sat May 13 18:10:28 CEST 2017
On Fri, May 12, 2017 at 3:40 PM Kareem Hepburn <kareemgan@REDACTED> wrote:
> Gotcha. Thanks! I was using Reject earlier but I guess Ack is sufficient
> to what I need to do.
When you reject a message, you can choose if it should be requeued or not.
Here it is good to build your application such that it knows if the message
is likely to succeed later or not. If you can't parse the message, say,
then it will never work. If your database is currently down, you can try
later, for instance. Think the difference between HTTP 4xx errors (client
side) or 5xx errors (server side).
You want to make the discrimination because otherwise a single "poisonous"
message will get sent to all your workers and that can take all the workers
down by infecting them one by one. Granted, Erlang makes that harder by
restarting. Yet, I've seen such problems in production. I've also seen what
it does to a Python system with no supervisor restarts. It aint' pretty :)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions