[rabbitmq-discuss] SocketException when invoking model.BasicPublish

Scott McFadden scott.kendall.mcfadden at gmail.com
Thu Jun 19 02:27:58 BST 2014


Forgot to list the client code.  Client dies when trying to publish 
(IOException - unable to read from transport):

private void PublishMessage(byte[] message, Type messageType, string 
contentType, string messageId)
        {
            var factory = new ConnectionFactory() {VirtualHost = 
this.VirtualHost, HostName = this.Host, UserName = this.User, Password = 
this.Password };
            using (var connection = factory.CreateConnection())
            using (var channel = connection.CreateModel())
            {
                IBasicProperties props = channel.CreateBasicProperties();
                props.SetPersistent(this.PersistMessages);                
                
                //Mime time
                props.ContentType = contentType;
                props.Type = messageType.FullName;
                props.MessageId = messageId;

                
//http://www.rabbitmq.com/tutorials/tutorial-three-dotnet.html
                
                //Note, may get AlreadyClosedException here if publishing 
to a incorrect exchange name
                channel.BasicPublish(this.ExchangeName, this.RoutingKey, 
props, message);
            }
        }


Server side error is this:

=ERROR REPORT==== 18-Jun-2014::20:24:03 ===
AMQP connection <0.286.0> (running), channel 1 - error:
{amqp_error,unexpected_frame,
            "expected content header for class 60, got non content header 
frame instead",
            'basic.publish'}

=INFO REPORT==== 18-Jun-2014::20:24:03 ===
closing AMQP connection <0.286.0> (172.17.9.14:53072 -> 172.17.9.24:5672)




On Wednesday, June 18, 2014 5:47:12 PM UTC-5, Scott McFadden wrote:
>
> We get a SocketException when RabbitMQClient::SocketFrameHandler tries to 
> invoke SendHeader (IPV4).
>
> I installed Rabbit MQ on our Win2008 dev server as my domain user.  It's 
> configured to run as Windows Service / LocalSystem.
>
> How should I troubleshoot this error?
>
>
> Server = Rabbitmq_server-3.3.0 (Windows Server 2008, No Firewall)
> Client = .NET /  RabbitMQ.Client 3.3.0.0
>
>
> C:\Program Files (x86)\RabbitMQ 
> Server\rabbitmq_server-3.3.0\sbin>rabbitmqctl.bat status
>
> Status of node rabbit at DEVTEST01 ...
> Error: unable to connect to node rabbit at DEVTEST01: nodedown
>
> DIAGNOSTICS
> ===========
>
> attempted to contact: [rabbit at DEVTEST01]
>
> rabbit at DEVTEST01:
>   * found rabbit (port 25672)
>   * TCP connection succeeded
>   * suggestion: hostname mismatch?
>   * suggestion: is the cookie set correctly?
>
> current node details:
> - node name: rabbitmqctl2618644 at DEVTEST01
> - home dir: C:\Windows\system32
> - cookie hash: ZmgA84wX0aHnw48E/7gOGg==
>
>
>
>
>
> thanks
>
> scott
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140618/9ac36bd4/attachment.html>


More information about the rabbitmq-discuss mailing list