Here I am again, this time with something that looks like a bug.
I have a request reply mechanism using a client pc WPF app and a server with RabbitMQ and a Windows Service installed.
When I configure the Windows Service bus instance to use the server name:
Const rabbitMQServer As String = "SDWBusT01"
Const appName As String = "DossierbeheerderDashboard"
Const dossierbeheerderdashboardUrl As String = "rabbitmq://" & rabbitMQServer & "/" & appName
config.UseRabbitMq(Sub(rmq)
rmq.ConfigureHost(New Uri(dossierbeheerderdashboardUrl), _
Sub(host)
host.SetPassword("services")
host.SetUsername("services")
End Sub)
End Sub)
config.ReceiveFrom(dossierbeheerderdashboardUrl)
Everything works fine, messages are sent and received as expected.
However when I change the configuration to use localhost like this:
Const rabbitMQServer As String = "localhost"
Const appName As String = "DossierbeheerderDashboard"
Const dossierbeheerderdashboardUrl As String = "rabbitmq://" & rabbitMQServer & "/" & appName
config.UseRabbitMq(Sub(rmq)
rmq.ConfigureHost(New Uri(dossierbeheerderdashboardUrl), _
Sub(host)
host.SetPassword("services")
host.SetUsername("services")
End Sub)
End Sub)
config.ReceiveFrom(dossierbeheerderdashboardUrl)
The windows service still receives the message, but an exception will occur during the send method.
Message: rabbitmq://sdwbust01/DossierbeheerderDashboard => An exception was thrown during Send
Inner Exception: None of the specified endpoints were reachable
If I dig through the RabbitMQ logs I found the following problem:
=INFO REPORT==== 7-May-2014::15:03:13 ===
accepting AMQP connection <0.20918.1> ([FE80::1983:53BD:45B4:6374]:58216 -> [FE80::1983:53BD:45B4:6374]:5672)
=ERROR REPORT==== 7-May-2014::15:03:16 ===
closing AMQP connection <0.20918.1> ([FE80::1983:53BD:45B4:6374]:58216 -> [FE80::1983:53BD:45B4:6374]:5672):
{handshake_error,starting,0,
{amqp_error,access_refused,
"PLAIN login refused: user 'guest' - invalid credentials",
'connection.start_ok'}}
=WARNING REPORT==== 7-May-2014::15:03:26 ===
closing AMQP connection <0.20857.1> ([::1]:58214 -> [::1]:5672):
connection_closed_abruptly
Which makes me think the service thinks the reponseaddress (which uses the servername instread of localhost) is on a different host and MassTransit uses the default guest account to login.
To prove my point: when I re-add the default account, no exceptions occur.
My gut tells me this is a bug, but I might be wrong.