[rabbitmq-discuss] 2.3.1 WCF Binding not honouring virtual host, username or password

Damien Jones damien.jones at aclaro.com
Fri Feb 25 16:26:10 GMT 2011


Hi all,

I configured the RabbitMQ server with a new user and a virtual host, and set
up my WCF bindings with the appropriate information.
Regardless my connections were always being set up for the default user and
vhost.
Debugging the RabbitMQ.ServiceModel it turned out that the ConnectionFactory
being used was missing the configuration settings, which I traced to the
private constructor of RabbitMQTransportBindingElement:

        private
RabbitMQTransportBindingElement(RabbitMQTransportBindingElement other)
            : this()
        {
            Broker = other.Broker;
            BrokerProtocol = other.BrokerProtocol;
        }

and resolved by adding initialization of the m_connectionFactory member:

        private
RabbitMQTransportBindingElement(RabbitMQTransportBindingElement other)
            : this()
        {
            m_connectionFactory.Password = other.ConnectionFactory.Password;
            m_connectionFactory.UserName = other.ConnectionFactory.UserName;
            m_connectionFactory.VirtualHost =
other.ConnectionFactory.VirtualHost;

            Broker = other.Broker;
            BrokerProtocol = other.BrokerProtocol;
        }

Is this a reasonable thing to do?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20110225/d6f45d6a/attachment.htm>


More information about the rabbitmq-discuss mailing list