No subject
Sun Jun 17 23:12:48 BST 2012
there a workaround for this issue? I'm surprised the connection drops
silently without any warning despite using heartbeats.
ConnectionFactory factory = new ConnectionFactory();
factory.setHost(host);
factory.setRequestedHeartbeat(10);
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(exchange, "topic");
String queueName = channel.queueDeclare().getQueue();
channel.queueBind(queueName, exchange, topic);
consumer = new QueueingConsumer(channel);
channel.basicConsume(queueName, true, consumer);
I've tried adding this to my rabbitmq.config:
[
{rabbit, [{tcp_listen_options, [{keepalive, true}]}]}
].
but I receive errors as soon as I try to subscribe:
Exception in thread "main" java.io.IOException
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:106)
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:102)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:353)
at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:516)
at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:533)
at
vantage.messaging.rabbitmq.RabbitMqPublisher.<init>(RabbitMqPublisher.java:28)
at vantage.messaging.rabbitmq.TimeoutTest.main(TimeoutTest.java:13)
Caused by: com.rabbitmq.client.ShutdownSignalException: connection error;
reason: java.io.EOFException
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:67)
at
com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:33)
at
com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:343)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:306)
... 4 more
Caused by: java.io.EOFException
at java.io.DataInputStream.readUnsignedByte(DataInputStream.java:290)
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:95)
at
com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:131)
at
com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:501)
--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/RabbitMQ-subscriber-loses-connection-across-firewalls-after-long-idle-tp20480.html
Sent from the RabbitMQ mailing list archive at Nabble.com.
More information about the rabbitmq-discuss
mailing list