[rabbitmq-discuss] Lost messages after consumer crash
Alexandru Scvortov
alexandru at rabbitmq.com
Mon Feb 14 13:58:53 GMT 2011
Hi again,
The confirm stuff is to get the server to take responsibility for the
messages (so, after you get the confirm for the message, you know it's
either been written to disk or sent to a consumer).
In general, the only way to see if a certain consumer has received a
message is to have that consumer publish an acknowledgement message to
some queue for the producer to see.
> > I've noticed that if I crash (Ctrl+C) the consumer in the middle if
> > the message reception flow and then start it up again, there's a gap
> > in the messages delivered
Check if the messages aren't being sent at the end (if a consumer
consumes a messages and dies before ack'ing, the messages are requeued
at the end).
> > Changing to ... manual ack didn't seem to help.
Make sure you're not in autoack mode. If you are, it's possible that
the java client isn't flushing it's stdout buffer before dying.
Cheers,
Alex
On Mon, Feb 14, 2011 at 03:45:24PM +0200, Alexandru Scvorţov wrote:
> Hi,
>
> Have a look at this (only applies to 2.3.0):
> http://www.rabbitmq.com/blog/2011/02/10/introducing-publisher-confirms/
>
> If that doesn't help, could you post the code you're using?
>
> Cheers,
> Alex
>
> On Mon, Feb 14, 2011 at 09:50:47AM -0200, Fabio Margarido wrote:
> > Hi there.
> > I'm new to RabbitMQ and this list. I've searched the archives but
> > haven't found an answer for my question, sorry if it's been asked
> > before.
> > I've downloaded the server and Java client packages and started
> > playing around. I've slightly modified the example Java code so that
> > the producer sends 100000 messages in a loop. Each message contains a
> > sequential number.
> > I've noticed that if I crash (Ctrl+C) the consumer in the middle if
> > the message reception flow and then start it up again, there's a gap
> > in the messages delivered, i.e., the sequential numbers after the
> > restart don't pick up from where they stopped. I thought this might be
> > related to Java and only the printing of the messages, but some quick
> > analysis of the network traces showed that apparently the non printed
> > messages are missing from the transmission.
> > Changing to transaction mode and manual ack didn't seem to help.
> > Has anyone seen this behavior before? Am I missing something? How can
> > I guarantee that all the messages are delivered?
> > Thanks in advance.
> >
> > Fabio
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
More information about the rabbitmq-discuss
mailing list