[rabbitmq-discuss] TCP timeouts

David.Corcoran at edftrading.com David.Corcoran at edftrading.com
Wed May 7 12:31:48 BST 2008


I've run into a problem testing RabbitMQ. My Java clients keep
disconnecting when using a lot of CPU and the error in the RabbitMQ logs
=ERROR REPORT==== 7-May-2008::11:41:44 ===
error on TCP connection from

I'm using channel.basicGet and I think I've narrowed down the problem. When
I get a message I process it, then call basicAck once it's done. So the
code looks like:
GetResponse basicGet = channel.basicGet(ticket, queueName, false);
 if (basicGet != null) {
        channel.basicAck(basicGet.getEnvelope().getDeliveryTag(), false);

if process() looks like this:
            long start = System.currentTimeMillis();
            while(true) {
                long now = System.currentTimeMillis();
                if(now - start > 10000) {
The client will disconnect. If I add a Thread.sleep(0) into the loop it
will work fine. The sleep 0 just yields. In my real code it doesn't do that
loop but does do a lot of maths that can take up to about 1 minute so it
has the same effect of killing the CPU for a while.

I guess what's happening is that the connection thread isn't getting any
time to send heartbeats and the server is disconnecting it. Is there a work
around for this? Can I change the heartbeat?

A little more information if that helps:
 - Quad core machine, only using 1 cpu during this test
 - 4GB Ram
 - Erlang 5.5.5 (64bit)
 - Ubunut 64
 - Rabbit mq 1.3.0-1



This communication contains confidential information, some or all of which may be privileged. It is for the intended recipient only and others must not disclose, distribute, copy, print or rely on this communication. If an addressing or transmission error has misdirected this communication, please notify the sender by replying to this e-mail and then delete the e-mail. E-mail sent to EDF Trading may be monitored by the company. Thank you. 
EDF Trading Limited
80 Victoria Street, 3rd Floor, Cardinal Place, London, SW1E 5JL
A Company registered in England No. 4255974. 
Switchboard: 020 7061 4000
EDF Trading Markets Limited is a member of the EDF Trading Limited Group and is authorised and regulated by the Financial Services Authority.
VAT number: GB 735 5479 07

More information about the rabbitmq-discuss mailing list