Skip to content

Instantly share code, notes, and snippets.

@phatboyg
Created February 12, 2013 13:09
Show Gist options
  • Save phatboyg/4762944 to your computer and use it in GitHub Desktop.
Save phatboyg/4762944 to your computer and use it in GitHub Desktop.
Logical to physical address mapping for RabbitMQ
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)));
}))
@phatboyg
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment