[rabbitmq-discuss] RabbitMQ 1.7.0 close the cnx when consumer don't ack deliveries during 30s
Simon MacMullen
simon at rabbitmq.com
Wed Jul 14 17:53:07 BST 2010
Hi Vincent. Yes, I think you could do that, although you have to think
about what to do when there aren't 1000 messages to deliver - would you
just wait indefinitely?
It does sound like you'd be building something like a fixed-length
QueueingConsumer though - I don't really see what that would gain you.
Cheers, Simon
On 14/07/10 17:38, Vincent Barat wrote:
> Concerning this issue, I've read about the basicQos() call.
>
> Do you think that I can use this call to force the server to send me a
> maximum of, say, 1000 messages that I could store in an array in
> handleDelivery() (without blocking), and, once I've counted 1000
> messages exactly, I trigger another thread to store all messages and
> then ack all messages ?
>
> Le 14/07/10 11:30, Simon MacMullen a écrit :
>> On 13/07/10 16:00, Vincent Barat wrote:
>> <snip>
>>> But from time to time, the database blocks during 30s to 1minute and
>>> thus I don't acknowledge during the same time.
>>>
>>> It seems that the RabbitMQ server closes the connection. Is there a
>>> timeout (or a setting) I can use to fix this issue ?
>>
>> Hi Vincent. Not acking for 30s certainly should not close the
>> connection. When the server closes a connection due to client error it
>> sends an error message; you should see this as an IOException in the
>> Java client. Check the ShutdownSignalException inside the IOException
>> to get the error code / message. Alternatively you could look in the
>> server logs, sometimes there's more detail there.
>>
>> One way this could be happening is:
>>
>> * You have heartbeating turned on (I think some of the client version
>> have this turned on by default). Heartbeating makes the server
>> periodically check the client is still alive and responding.
>>
>> * You block the connection main loop, say by implementing your own
>> Consumer rather than using QueueingConsumer, and doing something slow
>> / expensive in Consumer.handleDelivery().
>>
>> Does this sound plausible? If not I would look for error messages as
>> above.
>>
>> Cheers, Simon
>>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
--
Simon MacMullen
Staff Engineer, RabbitMQ
SpringSource, a division of VMware
More information about the rabbitmq-discuss
mailing list