<div dir="ltr">Hello Michael, per your suggestion I put the open connection logic in the class initializer (it only happens once right after construction). Getting the connection works fine. However basic publish still encounters an error. However, the error is slightly different this time around. I invoked the java tracing proxy so you can see the wire data.<div>
<br></div><div><div>Client side error when invoking basic publish:</div><div><br></div><div>System.ArgumentNullException: String reference not set to an instance of a String.</div><div>Parameter name: s</div><div> at System.Text.Encoding.GetBytes(String s)</div>
<div> at RabbitMQ.Client.Impl.WireFormatting.WriteShortstr(NetworkBinaryWriter writer, String val)</div><div> at RabbitMQ.Client.Impl.ContentHeaderPropertyWriter.WriteShortstr(String val)</div><div> at RabbitMQ.Client.Framing.v0_9_1.BasicProperties.WritePropertiesTo(ContentHeaderPropertyWriter writer)</div>
<div> at RabbitMQ.Client.Impl.ContentHeaderBase.WriteTo(NetworkBinaryWriter writer, UInt64 bodySize)</div><div> at RabbitMQ.Client.Impl.Command.Transmit(Int32 channelNumber, ConnectionBase connection)</div><div> at RabbitMQ.Client.Impl.SessionBase.Transmit(Command cmd)</div>
<div> at RabbitMQ.Client.Impl.ModelBase.ModelSend(MethodBase method, ContentHeaderBase header, Byte[] body)</div><div> at RabbitMQ.Client.Framing.Impl.v0_9_1.Model._Private_BasicPublish(String exchange, String routingKey, Boolean mandatory, Boolean immediate, IBasicProperties basicProperties, Byte[] body)</div>
<div> at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, Boolean mandatory, Boolean immediate, IBasicProperties basicProperties, Byte[] body)</div><div> at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, Boolean mandatory, IBasicProperties basicProperties, Byte[] body)</div>
<div> at RabbitMQ.Client.Impl.ModelBase.BasicPublish(String exchange, String routingKey, IBasicProperties basicProperties, Byte[] body)</div><div><br></div><div><br></div><div>Tracer output:</div></div><div><br></div><div>
<div>Usage: Tracer [<listenport> [<connecthost> [<connectport>]]]</div><div> Serially traces connections on the <listenport>, logging</div><div> frames received and passing them to the connect host and port.</div>
<div>Invoked as: Tracer 5672 devtest01 5672</div><div>com.rabbitmq.tools.Tracer.WITHHOLD_INBOUND_HEARTBEATS = false</div><div>com.rabbitmq.tools.Tracer.WITHHOLD_OUTBOUND_HEARTBEATS = false</div><div>com.rabbitmq.tools.Tracer.NO_ASSEMBLE_FRAMES = false</div>
<div>com.rabbitmq.tools.Tracer.NO_DECODE_FRAMES = false</div><div>com.rabbitmq.tools.Tracer.SUPPRESS_COMMAND_BODIES = false</div><div>1403231368956: <Tracer-0> ch#0 <- {#method<connection.start>(version-major=0, v</div>
<div>rsion-minor=9, server-properties={product=RabbitMQ, cluster_name=rabbit@DEVTEST</div><div><a href="http://1.criticaltech.com">1.criticaltech.com</a>, information=Licensed under the MPL. See <a href="http://www.rabbitm">http://www.rabbitm</a></div>
<div>.com/, platform=Erlang/OTP, capabilities={exchange_exchange_bindings=true, auth</div><div>ntication_failure_close=true, consumer_priorities=true, consumer_cancel_notify=</div><div>rue, basic.nack=true, publisher_confirms=true, connection.blocked=true}, copyri</div>
<div>ht=Copyright (C) 2007-2013 GoPivotal, Inc., version=3.3.0}, mechanisms=AMQPLAIN</div><div>PLAIN, locales=en_US), null, ""}</div><div>1403231368956: <Tracer-0> ch#0 -> {#method<connection.start-ok>(client-properti</div>
<div>s={product=RabbitMQ, platform=.NET, information=Licensed under the MPL. See ht</div><div>p://<a href="http://www.rabbitmq.com/">www.rabbitmq.com/</a>, copyright=Copyright (C) 2007-2013 GoPivotal, Inc., capab</div><div>
lities={exchange_exchange_bindings=true, authentication_failure_close=true, con</div><div>umer_cancel_notify=true, basic.nack=true, publisher_confirms=true, connection.b</div><div>ocked=true}, version=3.3.0.0}, mechanism=PLAIN, response= logmanager rfc1945, l</div>
<div>cale=en_US), null, ""}</div><div>1403231369155: <Tracer-0> ch#0 <- {#method<connection.tune>(channel-max=0, fram</div><div>-max=131072, heartbeat=580), null, ""}</div><div>1403231369159: <Tracer-0> ch#0 -> {#method<connection.tune-ok>(channel-max=0, f</div>
<div>ame-max=131072, heartbeat=580), null, ""}</div><div>1403231369161: <Tracer-0> ch#0 -> {#method<connection.open>(virtual-host=/, cap</div><div>bilities=, insist=false), null, ""}</div>
<div>1403231369374: <Tracer-0> ch#0 <- {#method<connection.open-ok>(known-hosts=), n</div><div>ll, ""}</div><div>1403231383444: <Tracer-0> ch#1 -> {#method<channel.open>(out-of-band=), null, "</div>
<div>}</div><div>1403231383668: <Tracer-0> ch#1 <- {#method<channel.open-ok>(channel-id=), null,</div><div>""}</div><div>Exception in thread "Thread-2" com.rabbitmq.client.UnexpectedFrameError: Receiv</div>
<div>d frame: Frame(type=1, channel=1, 18 bytes of payload), expected type 2Stopped.</div><div><br></div><div> at com.rabbitmq.client.impl.CommandAssembler.consumeHeaderFrame(Command</div><div>ssembler.java:106)</div>
<div> at com.rabbitmq.client.impl.CommandAssembler.handleFrame(CommandAssembl</div><div>r.java:159)</div><div> at com.rabbitmq.client.impl.AMQCommand.handleFrame(AMQCommand.java:87)</div><div> at com.rabbitmq.tools.Tracer$DirectionHandler.doFrame(Tracer.java:331)</div>
<div> at com.rabbitmq.tools.Tracer$DirectionHandler.run(Tracer.java:343)</div><div> at java.lang.Thread.run(Unknown Source)</div></div><div><br></div><div><br></div><div>Server output</div><div><br></div><div>
<div>=INFO REPORT==== 19-Jun-2014::21:29:29 ===</div><div>accepting AMQP connection <0.646.0> (<a href="http://172.17.9.14:57049">172.17.9.14:57049</a> -> <a href="http://172.17.9.24:5672">172.17.9.24:5672</a>)</div>
<div><br></div><div>=ERROR REPORT==== 19-Jun-2014::21:29:47 ===</div><div>AMQP connection <0.646.0> (running), channel 1 - error:</div><div>{amqp_error,unexpected_frame,</div><div> "expected content header for class 60, got non content header frame instead",</div>
<div> 'basic.publish'}</div><div><br></div><div>=INFO REPORT==== 19-Jun-2014::21:29:47 ===</div><div>closing AMQP connection <0.646.0> (<a href="http://172.17.9.14:57049">172.17.9.14:57049</a> -> <a href="http://172.17.9.24:5672">172.17.9.24:5672</a>)</div>
</div><div><br></div><div><br></div><div>This client code use to work before we had to restore an old VM snapshot of the RabitMQ server. We had to re-install / re-configure our RabbitMQ on the vm image. Not sure what I have done to foul it up.</div>
<div><br></div><div>Please advise.</div><div><br></div><div><br></div><div>thanks</div><div><br></div><div>Scott McFadden</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Wed, Jun 18, 2014 at 10:05 PM, Michael Klishin <span dir="ltr"><<a href="mailto:mklishin@gopivotal.com" target="_blank">mklishin@gopivotal.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class=""> On 19 June 2014 at 07:02:17, Scott McFadden (<a href="mailto:scott.kendall.mcfadden@gmail.com">scott.kendall.mcfadden@gmail.com</a>) wrote:<br>
> > It makes me think I screwed up the server side configuration<br>
> when reinstalling.<br>
<br>
</div>There is no configuration that can affect framing/frame interleaving in the client.<br>
This is also the kind of issues that we'd see reported constantly if it was a client<br>
issue. Finally, it happens on a brand new connection.<br>
<br>
I'd recommend doing two things:<br>
<br>
* Running a tracer proxy in front of RabbitMQ [1] to see what's being sent on the wire<br>
* Open a connection on app start if you can instead of opening a new one per channel<br>
<br>
If the latter does not change anything, please post the output of the tracer.<br>
<br>
1. <a href="http://www.rabbitmq.com/java-tools.html" target="_blank">http://www.rabbitmq.com/java-tools.html</a>, see Tracer<br>
<div class="HOEnZb"><div class="h5">--<br>
MK<br>
<br>
Software Engineer, Pivotal/RabbitMQ<br>
</div></div></blockquote></div><br></div>