Messages are read by consumer befor than sender get confirmation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Messages are read by consumer befor than sender get confirmation

Haster
Hi folks,

I have a sender, that sends messages to some exchange EX and after that waits confirmation from RabbitMQ
(I use confirmation mode + mandatory bit)
And there is a consumer that reads messages from queue QU that is bind to EX.

And I have a situation then consumer get messages before sender receive confirmation from RabbitMQ.

can I change this behavior?

And one more problem that I have...
I wait confirmation from RabbitMQ for some time and I often  get timeout, but messages were published successfully (so timeout happend during I'm waiting for ACK or RETURN method).
So can I change this situation and delete message from queue if I receive timeout?

I think no, but maybe =)



Reply | Threaded
Open this post in threaded view
|

Re: Messages are read by consumer befor than sender get confirmation

Simon MacMullen-2
On 18/06/14 09:12, Haster wrote:

> Hi folks,
>
> I have a sender, that sends messages to some exchange EX and after that
> waits confirmation from RabbitMQ
> (I use confirmation mode + mandatory bit)
> And there is a consumer that reads messages from queue QU that is bind to
> EX.
>
> And I have a situation then consumer get messages before sender receive
> confirmation from RabbitMQ.
>
> can I change this behavior?

No, that's an optimisation. When the message is persistent it can be
delivered to the consumer before it's been written to disk, and thus
before the publisher receives a confirm.

> And one more problem that I have...
> I wait confirmation from RabbitMQ for some time and I often  get timeout,
> but messages were published successfully (so timeout happend during I'm
> waiting for ACK or RETURN method).
> So can I change this situation and delete message from queue if I receive
> timeout?
>
> I think no, but maybe =)

I'm afraid not. Those timeouts are presumably implemented in your
client, they're not a protocol-level thing. So the server never knows
they've fired.

Cheers, Simon

--
Simon MacMullen
RabbitMQ, Pivotal
_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
Reply | Threaded
Open this post in threaded view
|

Re: Messages are read by consumer befor than sender get confirmation

Haster
Simon,
thanks a lot for answer
Reply | Threaded
Open this post in threaded view
|

Re: Messages are read by consumer befor than sender get confirmation

fbrandao
This post has NOT been accepted by the mailing list yet.
In reply to this post by Simon MacMullen-2
Hi Simon,

I understand that this is an optimisation but, what can I do if I need to know that my message was routed to a queue (and persisted) in rabbit with low latency / timeout (say like less than 2 seconds), but my consumer has a slow process to execute?
Ow, I need to guarantee that my message was routed and persisted and I cannot loose any message!

Thanks in advance,
Fabio