[rabbitmq-discuss] SocketException when invoking model.BasicPublish

Michael Klishin mklishin at gopivotal.com
Fri Jun 20 04:50:59 BST 2014



On 20 June 2014 at 06:39:58, Scott McFadden (scott.kendall.mcfadden at gmail.com) wrote:
> > System.ArgumentNullException: String reference not set  
> to an instance of a String.
> Parameter name: s
> at System.Text.Encoding.GetBytes(String s)
> at RabbitMQ.Client.Impl.WireFormatting.WriteShortstr(NetworkBinaryWriter  
> writer, String val)
> at RabbitMQ.Client.Impl.ContentHeaderPropertyWriter.WriteShortstr(String  
> val)
> at RabbitMQ.Client.Framing.v0_9_1.BasicProperties.WritePropertiesTo(ContentHeaderPropertyWriter  
> writer)
> at RabbitMQ.Client.Impl.ContentHeaderBase.WriteTo(NetworkBinaryWriter  
> writer, UInt64 bodySize)
> at RabbitMQ.Client.Impl.Command.Transmit(Int32 channelNumber,  

…

> Exception in thread "Thread-2" com.rabbitmq.client.UnexpectedFrameError:  
> Receiv
> d frame: Frame(type=1, channel=1, 18 bytes of payload), expected  
> type 2Stopped.
>  
> at com.rabbitmq.client.impl.CommandAssembler.consumeHeaderFrame(Command  
> ssembler.java:106)
> at com.rabbitmq.client.impl.CommandAssembler.handleFrame(CommandAssembl  
> r.java:159)
> at com.rabbitmq.client.impl.AMQCommand.handleFrame(AMQCommand.java:87)  

Scott,

This suggests that one of the message properties that is expected to be a string
is not set to a string. In your code, you do

props.SetPersistent(this.PersistMessages);                
props.ContentType = contentType;
props.Type = messageType.FullName;
props.MessageId = messageId;

Can you please try identifying which property it is by elimination and
send me (off-list if there's something confidential) what its value
is at runtime?

Both RabbitMQ and Tracer cannot decode what the client sends over the wire,
I suspect this is a genuine .NET client issue: it doesn't reject the inputs
it should.

Also, what encoding does the system use by default and what OS and .NET version
do you run? 
--  
MK  

Software Engineer, Pivotal/RabbitMQ


More information about the rabbitmq-discuss mailing list