NServiceBus/NServiceBus — pull request #1118 by thirkcircus (2013-04-16 21:26:03+00:00)
Title: Add cluster support to RabbitMQ transport

resolves issue #972

I'm reusing the https://github.com/mikehadlow/EasyNetQ implementation (see forum discussion: http://tech.groups.yahoo.com/group/nservicebus/message/18588)

EasyNetQ code copied in exactly as-is, same namespaces and everything, so bringing in any future improvements to EasyNetQ should be as easy as copy/paste. (EasyNetQ license is MIT, license also copied into the NSB project.)

The core NServiceBus implementation is now using the EasyNetQ connectionstring parser - I've modified the RabbitMqTransportConfigurer to use the cluster-aware connection factory bits:
```csharp
var connectionStringParser = new ConnectionStringParser();
var connectionConfiguration = connectionStringParser.Parse(connectionString);
config.Configurer.ConfigureComponent(() => connectionConfiguration, DependencyLifecycle.SingleInstance);
config.Configurer.ConfigureComponent>(x => new DefaultClusterHostSelectionStrategy(), DependencyLifecycle.InstancePerCall);
config.Configurer.ConfigureComponent(x => new ConnectionFactoryWrapper(
x.Build(),
x.Build>()), DependencyLifecycle.InstancePerCall);
var connectionFactory = NServiceBus.Configure.Instance.Builder.Build < IConnectionFactory>();
```

I've also created some integration tests to prove the failover - these stand up a (new) cluster of local rabbitMQ nodes, run the test and take the cluster down again. See the readme in the cluster tests dir for requirements (although, assuming rabbit is installed then the tests *should* just work). Please let me know if there are any aspects of the tests which do fall over if/when someone else runs them - I've tried to make them machine-independent but there may be things I've missed.

example log output from the test "when_connected_to_local_cluster_and_nodes_start_going_down":
![17-04-2013 9-01-53 a-m-](https://f.cloud.github.com/assets/81165/388452/a7f6f2b8-a6da-11e2-8a84-47b59981a446.png)

One request:
Internally we (my employer) are using daily NSB nuget packages off the develop branch - means we don't need to stand up our own NSB fork/nuget repo. But... this obviously means we don't get the benefits of our pull requests until they make it into develop. So... given I convinced my employer it was worth giving me a day to do this PR I'm now keen to see it progressed into develop sooner rather than later. Please. :)