ruby-amqp/bunny — Issue #28: Can't use Bunny with the RabbitMq Tracer tool
Author: guyboertje
Created: 2011-10-25 14:32:47+00:00
State: open

I use the Tracer tool ( http://www.rabbitmq.com/examples.html#tracer ) to debug my jruby and 1.9.2 applications. I recently added bunny to a rails app to (only) publish to a RabbitMq exchange. With the tracer in between RabbitMq server and the ruby app, I see a java exception in the Tracer on the Bunny connection. Could the protocol be the problem ( first line )? The Java line is ch#0 <- {#method(version-major=0, version-minor=9 ...

Env: Rails App - Rails 3.1.1, Bunny 0.7.8, ruby 1.9.3pre1, RabbitMq 2.6.1, Tracer 2.6.1, thin
Background App - jRuby 1.6.4 Java 7, jMongo 1.1.4 (-> RabbitMq Java Driver, 2.6.5).

Added below is the relevant part of the Tracer output.
is the jRuby side
is the MRI Bunny side
It looks like the connection opens OK but the channel is not opened.

1319551245765: ch#3 -> {#method(),null,""}
1319551245799: ch#3 <- {#method(),null,""}
1319551245830: ch#0 <- {#method(version-major=8, version-minor=0, server-properties={product=RabbitMQ, information=Licensed under the MPL. See http://www.rabbitmq.com/, platform=Erlang/OTP, capabilities={}, copyright=Copyright (C) 2007-2011 VMware, Inc., version=2.6.1}, mechanisms=PLAIN AMQPLAIN, locales=en_US),null,""}
1319551245831: ch#0 -> {#method(client-properties={product=Bunny, platform=Ruby, information=http://github.com/ruby-amqp/bunny, version=0.7.8}, mechanism=AMQPL*****PASSWORD*****, locale=en_US),null,""}
1319551245870: ch#0 <- {#method(channel-max=0, frame-max=131072, heartbeat=0),null,""}
1319551245910: ch#0 -> {#method(channel-max=0, frame-max=131072, heartbeat=0),null,""}
1319551245910: ch#0 -> {#method(virtual-host=/user-test, capabilities=, insist=false),null,""}
1319551245920: ch#5 -> {#method(ticket=0, queue=message_failure, no-ack=false),null,""}
1319551245950: ch#0 <- {#method(known-hosts=),null,""}
1319551245960: ch#5 <- {#method(cluster-id=),null,""}
1319551245960: ch#5 -> {#method(ticket=0, queue=user, no-ack=false),null,""}
1319551245990: ch#1 -> {#method(out-of-band=),null,""}
1319551245999: ch#5 <- {#method(cluster-id=),null,""}
1319551246033: uncaught java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:392)
at com.rabbitmq.client.impl.ValueReader.readBytes(ValueReader.java:86)
at com.rabbitmq.client.impl.ValueReader.readLongstr(ValueReader.java:112)
at com.rabbitmq.client.impl.ValueReader.readLongstr(ValueReader.java:120)
at com.rabbitmq.client.impl.MethodArgumentReader.readLongstr(MethodArgumentReader.java:73)
at com.rabbitmq.client.impl.AMQImpl$Channel$OpenOk.(AMQImpl.java:600)
at com.rabbitmq.client.impl.AMQImpl.readMethodFrom(AMQImpl.java:3242)
at com.rabbitmq.client.impl.AMQCommand$Assembler.handleFrame(AMQCommand.java:266)
at com.rabbitmq.tools.Tracer$DirectionHandler.doFrame(Tracer.java:331)
at com.rabbitmq.tools.Tracer$DirectionHandler.run(Tracer.java:345)
at java.lang.Thread.run(Thread.java:722)