[rabbitmq-discuss] debugging via Java client causes handshake timeout?

45 views
Skip to first unread message

Shane

unread,
Jun 11, 2010, 1:35:43 PM6/11/10
to rabbitmq...@lists.rabbitmq.com
I've consistently got a handshake timeout connecting to RabbitMQ
running locally when I run test code via my IDE's debugger. Here's the
rabbit log output:

=INFO REPORT==== 11-Jun-2010::13:23:21 ===
accepted TCP connection on 0.0.0.0:5672 from 127.0.0.1:2108

=INFO REPORT==== 11-Jun-2010::13:23:21 ===
starting TCP connection <0.173.0> from 127.0.0.1:2108

=ERROR REPORT==== 11-Jun-2010::13:23:31 ===
exception on TCP connection <0.173.0> from 127.0.0.1:2108
{handshake_timeout,frame_header}

=INFO REPORT==== 11-Jun-2010::13:23:31 ===
closing TCP connection <0.173.0> from 127.0.0.1:2108

----
This is the exception from Java which I guess is happening because a
connection is never made?:

com.rabbitmq.client.AlreadyClosedException: clean connection shutdown;
reason: Attempt to use closed channel
at com.rabbitmq.client.impl.AMQChannel.ensureIsOpen(AMQChannel.java:
189)
at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:216)
at com.rabbitmq.client.impl.AMQChannel.rpc(AMQChannel.java:202)
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:
133)
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:
260)
at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:
200)
at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:
249)
at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:
263)
at
com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:
274)

----
My environment:
Windows XP
RabbitMQ Server 1.7.2
Java Client 1.7.2

If I run the same code NOT using my debugger, it's able to make a
connection and publish a message as expected. Is this a known issue or
is there a way to increase the timeout so I can use a debugger?
_______________________________________________
rabbitmq-discuss mailing list
rabbitmq...@lists.rabbitmq.com
http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss

Matthew Sackman

unread,
Jun 11, 2010, 1:39:13 PM6/11/10
to rabbitmq...@lists.rabbitmq.com
On Fri, Jun 11, 2010 at 10:35:43AM -0700, Shane wrote:
> If I run the same code NOT using my debugger, it's able to make a
> connection and publish a message as expected. Is this a known issue or
> is there a way to increase the timeout so I can use a debugger?

I'd suggest you just set the breakpoint after the connection has been
established. There is a 3 second timeout in the handshake with the
broker. This timeout is not exposed via configuration thus you'd need to
recompile the broker if you wished to change it. You'd need to change
the NORMAL_TIMEOUT and possible the HANDSHAKE_TIMEOUT too at the top of
rabbit_reader.erl.

Matthew

Matthew Sackman

unread,
Jun 11, 2010, 1:46:02 PM6/11/10
to Shane Witbeck, rabbitmq...@lists.rabbitmq.com
On Fri, Jun 11, 2010 at 01:42:14PM -0400, Shane Witbeck wrote:
> This seems to occur even if I have no breakpoints set.

That's very odd. I certainly have no problems working with the Java
client inside Eclipse's debugger. Which version of the java client are
you using, and which debugger are you working with?

Matthew Sackman

unread,
Jun 11, 2010, 1:50:56 PM6/11/10
to Shane Witbeck, rabbitmq...@lists.rabbitmq.com
Hi Shane,

Please try and keep the list CC'd.

On Fri, Jun 11, 2010 at 01:48:30PM -0400, Shane Witbeck wrote:
> IntelliJ IDEA 9.0.2 debugger with Java 1.6.0_18. Java client version is
> 1.7.2.

Hmm, I've not come across anyone else with the same issue. I don't use
IntelliJ, but I'm sure there are people on the list who do who may be
able to help out. Anyone?

Matthew

signature.asc

Oleg Zhurakousky

unread,
Jun 11, 2010, 2:01:00 PM6/11/10
to Matthew Sackman, rabbitmq...@lists.rabbitmq.com
I had the same problem few days ago (1.7.2). And you are correct, depending on where you put a breakpoint you will hang for longer then HANDSHAKE_TIMOUT which I believe is set for 10 sec ( public static final int HANDSHAKE_TIMEOUT = 10000;).

Hi Shane,

Matthew
<signature.asc><ATT00001..txt>

Reply all
Reply to author
Forward
0 new messages