Created
February 12, 2013 13:09
-
-
Save phatboyg/4762944 to your computer and use it in GitHub Desktop.
Logical to physical address mapping for RabbitMQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IServiceBus bus = ServiceBusFactory.New(c => | |
{ | |
c.ReceiveFrom("rabbitmq://logicalHost/my_queue"); | |
c.UseRabbitMq(r => | |
{ | |
r.ConfigureHost("rabbitmq://logicalhost/", h => | |
{ | |
h.SetUsername("testUser"); | |
h.SetPassword("test"); | |
h.UsePhysicalHosts("rabbitmq://server_a/", "rabbitmq://server_b"); | |
}); | |
}); | |
c.Subscribe(s => s.Handler<A>((context, message) => future.Complete(context))); | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
By configuring the system using logical hosts, the physical servers are decoupled from the message exchanges. The part that sucks is the headers such as SourceAddress point to addresses that do not exist. Therefore, it may be critical to come up with an additional dynamic header such as RabbitMQ-Physical-Hosts or something that gets set to the known physical servers at the time the message was sent. Seems like a lot of header traffic, but perhaps not.