[rabbitmq-discuss] WCF Bindings do not honor config settings

Dan B danbarua at gmail.com
Mon May 23 16:25:39 BST 2011


Hi all,

I've been playing around with the .Net client solution with a view to
using RabbitMQ with WCF.
I have changed my RabbitMQ username and password, so the WCF examples
explode because the ConnectionFactories are being initialized with the
default values.

To get the binding configuration values honoured, I changed lines
113-115 in RabbitMQBindingConfigurationElement.cs from

            rabbind.Transport.ConnectionFactory.Password =
this.Password;
            rabbind.Transport.ConnectionFactory.UserName =
this.Username;
            rabbind.Transport.ConnectionFactory.VirtualHost =
this.VirtualHost;

to
            rabbind.Transport.Password = this.Password;
            rabbind.Transport.Username = this.Username;
            rabbind.Transport.VirtualHost = this.VirtualHost;

So this now works where we have configured the endpoint to use non-
default settings for virtual host, username and password.

Moving onto trying to run the RabbitMQ.ServiceModel.Test project, to
see if we can set the config in code... similarly, setting the
hostname, port and protocol from app.config on the RabbitMQBinding has
no effect on the settings of the RabbitMQTransportBindingElement.
Username, password and virtual host properties on the
RabbitMQTransportBindingElementhave been marked as internal so can not
be modified from code.

Getting this to work requires a little more effort than modifying a
few lines - shall I just report this as a bug or may I submit a pull
request?

Regards,

Dan




More information about the rabbitmq-discuss mailing list