[erlang-questions] RabbitMQ message consumption

Bastien CHAMAGNE <>
Fri May 12 15:24:15 CEST 2017


Once a consumer reads a message, that message goes from "READY" to 
"UNACKED". It's not deleted that fast! As long as it's in "UNACKED" 
state, it will not be delivered to anyone else. Then once your consumer 
have finished processing the message, it must send an ACK that will 
remove the message from rabbitMQ. If your consumer crashes midway 
through, there will be no ACK and rabbitMQ knows that it can be 
redistributed (message is "READY" again).


On 12/05/2017 15:16, Kareem Hepburn wrote:
> What about reject? The thing is, if there are multiple nodes of a 
> worker that's consuming the message I want it that if a worker already 
> read the message, it will not be possible to for it to be delivered to 
> the other consumers so I am guessing ack will do this for me and 
> reject will requeue it if my process fails.
>
> Am I correct on this?
>
> On Fri, May 12, 2017 at 7:56 AM, Bastien CHAMAGNE < 
> <mailto:>> wrote:
>
>     Hi Kareem, you should ack only when your application have
>     processed the message. See https://www.rabbitmq.com/confirms.html
>     <https://www.rabbitmq.com/confirms.html>
>
>
>     On 12/05/2017 13:55, Kareem Hepburn wrote:
>>     Is it possible with RabbitMQ to consume a message without it
>>     being deleted and be deleted manually?
>>
>>     Because let's say I consumed a message and started to process it
>>     and half way through processing it the application fails. I want
>>     to be able to re-process that message again. Is it possible to
>>     not delete the message and delete it manually after my process
>>     has successfully completed?
>>
>>     To avoid duplication, I plan to use a secondary database, either
>>     Redis or Memcache to store the ID of the message to ensure that
>>     it's not being processed by more than one application.
>>
>>     Thanks!
>>
>>     -- 
>>
>>     kareemgan <http://kareemgan.com>
>>
>>     Kareem Gan / Software Engineer
>>      <mailto:>
>>
>>     Skype <https://github.com/magicalbanana> Facebook
>>     <http://facebook.com/dopankey> Twitter <http://@kareemgan> Google
>>     Plus <https://plus.google.com/108299918329354290658> Linkedin
>>     <https://linkedin.com/in/kareemgan> Skype <http://kareemgan>
>>
>>     This e-mail message may contain confidential or legally
>>     privileged information and is intended only for the use of the
>>     intended recipient(s). Any unauthorized disclosure,
>>     dissemination, distribution, copying or the taking of any action
>>     in reliance on the information herein is prohibited. E-mails are
>>     not secure and cannot be guaranteed to be error free as they can
>>     be intercepted, amended, or contain viruses. Anyone who
>>     communicates with us by e-mail is deemed to have accepted these
>>     risks. Company Name is not responsible for errors or omissions in
>>     this message and denies any responsibility for any damage arising
>>     from the use of e-mail. Any opinion and other statement contained
>>     in this message and any attachment are solely those of the author
>>     and do not necessarily represent those of the company.
>>
>>
>>
>>     _______________________________________________
>>     erlang-questions mailing list
>>      <mailto:>
>>     http://erlang.org/mailman/listinfo/erlang-questions
>>     <http://erlang.org/mailman/listinfo/erlang-questions>
>     _______________________________________________ erlang-questions
>     mailing list 
>     <mailto:>
>     http://erlang.org/mailman/listinfo/erlang-questions
>     <http://erlang.org/mailman/listinfo/erlang-questions> 
>
> -- 
>
> kareemgan <http://kareemgan.com>
>
> Kareem Gan / Software Engineer  
> <mailto:>
>
> Skype <https://github.com/magicalbanana> Facebook 
> <http://facebook.com/dopankey> Twitter <http://@kareemgan> Google Plus 
> <https://plus.google.com/108299918329354290658> Linkedin 
> <https://linkedin.com/in/kareemgan> Skype <http://kareemgan>
>
> This e-mail message may contain confidential or legally privileged 
> information and is intended only for the use of the intended 
> recipient(s). Any unauthorized disclosure, dissemination, 
> distribution, copying or the taking of any action in reliance on the 
> information herein is prohibited. E-mails are not secure and cannot be 
> guaranteed to be error free as they can be intercepted, amended, or 
> contain viruses. Anyone who communicates with us by e-mail is deemed 
> to have accepted these risks. Company Name is not responsible for 
> errors or omissions in this message and denies any responsibility for 
> any damage arising from the use of e-mail. Any opinion and other 
> statement contained in this message and any attachment are solely 
> those of the author and do not necessarily represent those of the company.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170512/8ee8794f/attachment.html>


More information about the erlang-questions mailing list