-
-
Save ept/141346 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Consuming example queue... | |
Exception in thread "main" com.rabbitmq.client.ShutdownSignalException: connection error; reason: java.io.EOFException | |
at com.rabbitmq.client.impl.AMQConnection.shutdown(AMQConnection.java:599) | |
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:461) | |
Caused by: java.io.EOFException | |
at java.io.DataInputStream.readUnsignedByte(Unknown Source) | |
at com.rabbitmq.client.impl.Frame.readFrom(Frame.java:117) | |
at com.rabbitmq.client.impl.SocketFrameHandler.readFrame(SocketFrameHandler.java:151) | |
at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:288) | |
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:431) | |
The exception happens approximately 3 seconds after "Consuming example queue..." is printed. | |
Framing of the problem: | |
- occurs reproducibly under Microsoft Windows XP Professional x64 Edition, Version 2003, Service Pack 2 | |
- occurs irrespective of whether server is on localhost or remote | |
- occurs irrespective of whether server connection is direct or tunneled through SSH | |
(NB. the SSH connection does not go down -- only the AMQP connection tunneled through it!) | |
- packet capture shows the initialization sequence completing fine; then, apparently out of | |
the blue, a TCP FIN packet is received by the client whereupon the connection is terminated | |
- other network connections are fine | |
- cannot reproduce under 32-Bit version of Windows or under Mac OS X | |
My hunch is that the RabbitMQ library may be using some network socket feature which is confusing | |
the Windows Network stack. Although I wouldn't know what that could be. (I also tried testing it | |
with a version of rabbitmq-java-client in which I removed the "setTcpNoDelay(true)" line, but it | |
made no difference.) | |
Scala application to reproduce this: | |
package com.example | |
import com.rabbitmq.client.{ConnectionFactory, QueueingConsumer} | |
object RabbitMQConnectionTest { | |
def main(args: Array[String]) { | |
val connection = new ConnectionFactory().newConnection("rabbitmq.example.com", 5672) | |
val channel = connection.createChannel | |
val blockingConsumer = new QueueingConsumer(channel) | |
channel.queueDeclare("example") | |
channel.basicConsume("example", blockingConsumer) | |
println("Consuming example queue...") | |
while (true) { | |
val delivery = blockingConsumer.nextDelivery | |
if (delivery != null) { | |
channel.basicAck(delivery.getEnvelope.getDeliveryTag, false) | |
} else { | |
println("null delivery") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment