[rabbitmq-discuss] C# Client + Virtual Host Problem

Bryan Murphy bmurphy1976 at gmail.com
Mon Oct 5 17:25:10 BST 2009


We're having trouble connecting to a RabbitMQ virtual host under mono.  If
we connect to the root virtual host (/) everything works fine.  Any insight
into what we might be doing wrong?  We're using v1.6.0 client driver.

Thanks,
Bryan




[2009-10-05 08:57:04,516] [INFO ] Establishing Message Bus Connection
[2009-10-05 08:57:04,517] [INFO ] Protocol: 0-8
[2009-10-05 08:57:04,517] [INFO ] Host: 10.255.203.226
[2009-10-05 08:57:04,518] [INFO ] Port: 5672
[2009-10-05 08:57:04,518] [INFO ] Virtual Host: /publisher

Unhandled Exception: None of the specified endpoints were reachable
Endpoints attempted:
  endpoint=amqp-0-8://10.255.203.226:5672, attempts=1, outcome=The AMQP
operation was interrupted: AMQP close-reason, initiated by Library, code=0,
text="End of stream", classId=0, methodId=0,
cause=System.IO.EndOfStreamException: Failed to read past end of stream.
  at System.IO.BinaryReader.ReadByte () [0x00047] in
/home/bmurphy/src/mono/mcs/class/corlib/System.IO/BinaryReader.cs:293
  at RabbitMQ.Client.Impl.Frame.ReadFrom (RabbitMQ.Util.NetworkBinaryReader
reader) [0x00000]
  at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.ReadFrame () [0x00000]
  at RabbitMQ.Client.Impl.ConnectionBase.MainLoopIteration () [0x00000]
  at RabbitMQ.Client.Impl.ConnectionBase.MainLoop () [0x00000]
Stack trace:
  at RabbitMQ.Client.ConnectionFactory.CreateConnection (Int32 maxRedirects,
RabbitMQ.Client.AmqpTcpEndpoint[] endpoints) [0x00000]
  at RabbitMQ.Client.ConnectionFactory.CreateConnection
(RabbitMQ.Client.AmqpTcpEndpoint[] endpoints) [0x00000]
  at RabbitMQ.Client.ConnectionFactory.CreateConnection (IProtocol version,
System.String hostName, Int32 portNumber) [0x00000]




rabbitmqctl status
Status of node 'rabbit at domU-12-31-39-01-C4-14' ...
[{running_applications,[{rabbit,"RabbitMQ","1.6.0"},
                        {mnesia,"MNESIA  CXC 138 12","4.4.3"},
                        {os_mon,"CPO  CXC 138 46","2.1.6"},
                        {sasl,"SASL  CXC 138 11","2.1.5.3"},
                        {stdlib,"ERTS  CXC 138 10","1.15.3"},
                        {kernel,"ERTS  CXC 138 10","2.12.3"}]},
 {nodes,['rabbit at domU-12-31-39-01-C4-14']},
 {running_nodes,['rabbit at domU-12-31-39-01-C4-14']}]
...done.




rabbitmqctl list_vhosts
Listing vhosts ...
/
/publisher
...done.




mono --version
Mono JIT compiler version 2.5 (/trunk/mono r142445 Tue Sep 22 18:25:08 PDT
2009)
Copyright (C) 2002-2008 Novell, Inc and Contributors. www.mono-project.com
        TLS:           __thread
        GC:            Included Boehm (with typed GC and Parallel Mark)
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  x86
        Disabled:      none




Relevant code:

        using RabbitMQConnectionFactory = RabbitMQ.Client.ConnectionFactory;

        public ConnectionFactory(MessageBusConnectionConfig config)
        {
            Contract.ArgumentNotNull("config", config);
            this.Config = config;
            this.ProviderConnectionFactory = new
RabbitMQConnectionFactory();

            if (!string.IsNullOrEmpty(config.VirtualHost))
                this.ProviderConnectionFactory.Parameters.VirtualHost =
config.VirtualHost;
        }

        public IConnection GetConnection()
        {
            if (_log.IsInfoEnabled)
            {
                _log.Info("Establishing Message Bus Connection");
                _log.Info("Protocol: " + Protocols.DefaultProtocol);
                _log.Info("Host: " + this.Config.ServerName);
                _log.Info("Port: " + (this.Config.ServerPort ?? 5672));
                _log.Info("Virtual Host: " +
this.ProviderConnectionFactory.Parameters.VirtualHost);
            }

            return new Connection(
                this.ProviderConnectionFactory.CreateConnection(
                    Protocols.DefaultProtocol,
                    this.Config.ServerName,
                    this.Config.ServerPort ?? 5672
                ));
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20091005/0b68f268/attachment.htm 


More information about the rabbitmq-discuss mailing list