⏱ 9 min read
Nobody chose to run three brokers. Somebody signed an acquisition.
How many message brokers does your company run?
Ask around and the honest answer is rarely one. There is the MSMQ system that has worked since 2011 and that nobody touches. There is RabbitMQ, which came with the company you bought two years ago. Then there is Azure Service Bus, because every new service goes to the cloud now. If someone in the AWS corner of the org chart is smiling, add SQS to the list.
Nobody designed this. Mergers, acquisitions and cloud moves did. And sooner or later a system on one broker needs data from a system on another.
The reflex is to put HTTP between the two worlds. One side gets an HTTP client, the other gets an endpoint, and the brokers stop mattering.
That costs more than it looks. Both systems change, so both get retested and redeployed. Someone has to host the HTTP endpoint, secure it, and keep it highly available. And the network between on-premises and cloud drops more often than anyone admits, so you end up writing your own retry logic - the same retries the broker was giving you for free.
Think about what you gave up there. Two systems that were built around asynchronous messages now depend on each other being up at the same moment. The whole reason they used a queue in the first place is gone.
If both sides already speak messages, don't make them speak HTTP to each other.
A messaging bridge is a small component that connects to two brokers at once. It pulls a message from a queue on one side and pushes it to a queue on the other, without changing the payload.
The part I like most is what the systems don't have to know. The sender puts a message on a queue in its own broker, the way it always has. The receiver reads from a queue in its own broker, the way it always has. Ideally neither side knows the bridge exists, and neither side knows the other one runs on different infrastructure.
You also keep the delivery guarantee. The bridge gives you at-least-once delivery, which makes it more reliable than the HTTP alternative. Remember that "at-least-once" part - it comes back later.
Here's a scenario that probably looks familiar. A .NET Framework application for employee scheduling runs on-premises. Its components talk to each other over MSMQ. It works, it's well structured, and the team has no plans to rewrite it.
Then the business wants a new consumer of the scheduling data. The IT strategy says new software goes to the cloud, so the new component runs on Azure Service Bus. The team also refuses to add synchronous calls between cloud and on-premises, so an outage on one side doesn't take the other down.
So they put a bridge in the middle, with two directions. One part reads from MSMQ and forwards to Service Bus. The other reads from Service Bus and forwards to MSMQ. The old app has no idea its new neighbour lives in Azure. The new components send Service Bus messages to the legacy app the same way they send them to each other.
There's a working version of this: Particular's MSMQ to Azure Service Bus sample, built on the NServiceBus Messaging Bridge. It's a separate package, NServiceBus.MessagingBridge, hosted on the .NET Generic Host. You tell it which endpoint lives on which transport:
await Host.CreateDefaultBuilder()
.UseNServiceBusBridge(bridgeConfiguration =>
{
var msmq = new BridgeTransport(new MsmqTransport());
msmq.HasEndpoint("Scheduling");
var asb = new BridgeTransport(
new AzureServiceBusTransport(connectionString, TopicTopology.Default));
asb.HasEndpoint("Scheduling.Reporting");
bridgeConfiguration.AddTransport(msmq);
bridgeConfiguration.AddTransport(asb);
})
.Build()
.RunAsync();
That's the whole routing table. The endpoints themselves stay untouched. In the docs' words, they "send/publish messages as if the entire system uses the same transport." Events work too, with one extra registration per event that tells the bridge who publishes it.

Here is the part I'd put in bold.
A regular message handler uses retries to spot poison messages. A message fails five times, the handler gives up and moves it to an error queue, and the rest of the queue keeps flowing. That's healthy. A message that fails every time is probably broken.
Now apply the same logic to the bridge. Service Bus goes down for ten minutes. The bridge picks up a message from MSMQ, tries to forward it, and fails. It retries, fails again, and moves it to the error queue. Then the next one. And the next. By the time Service Bus is back, the bridge has declared thousands of perfectly valid messages poison, and someone gets to replay all of them by hand.
Nothing was wrong with those messages. The destination was down. A bridge needs a different retry policy from a normal handler, one that can tell an infrastructure failure from a bad message. The fix I'd reach for is a Circuit Breaker that pauses forwarding while the other side is unreachable. Messages wait in the source queue, which is exactly what queues are for.
So before you deploy one, check what your bridge does when a broker disappears. The NServiceBus bridge, for example, does three immediate retries and then moves the message to a bridge.error queue. That's fine for a message that really is broken. For a broker outage, you want alerts on that queue and a plan for replaying it.
Lowest common denominator. The bridged route inherits the limits of both brokers. Take message size: MSMQ accepts messages up to 4 MB, Azure Storage queues stop at 64 KB. That one is easy to check. Harder are the features that simply don't exist on the other side - sessions, scheduled delivery, native deduplication. If your design relies on one of those, the bridge can't carry it across.
Duplicates. Remember at-least-once. If a system relies on distributed transactions (DTC) for correctness, the bridge needs deduplication. The NServiceBus docs are specific here: when the bridge moves messages between different transport types, receive-only is the only supported transaction mode, so a message can arrive twice. Their advice is idempotent handlers or the outbox. An MSMQ system that has leaned on DTC for fifteen years may never have needed either.
Topology. You have two options. A single bridging queue per broker, where senders are configured to send cross-broker messages there. Or a shadow queue per destination, created on the sender's broker, so the sender addresses the real endpoint name and never knows it crossed a bridge. The first is simpler to set up. The second keeps the systems unaware, which is the point of the pattern.
Skip the bridge when:
Start by counting your brokers. Write them down, with the systems on each one. Most teams I talk to find one more than they expected.
If two of them need to talk, try a bridge before an HTTP rewrite. It's one extra process to run, against changing and redeploying every system involved.
Give the bridge its own retry policy. Test it by killing the destination broker in a test environment and watching what happens to the error queue.
Make your handlers idempotent before you need them to be. Receive-only mode means duplicates are a question of when.
And use the bridge for migrations. Of everything it does, I think this is the most useful: move endpoints from MSMQ to Service Bus one at a time, as the schedule allows. Each moved endpoint becomes one line of configuration changing sides in the bridge. No big-bang weekend.
A bridge won't fix the fact that you run three brokers. It lets you stop pretending you don't, and gives you a way to shrink the number one endpoint at a time.
Just don't let it treat a broker outage like a bad message.
messaging-bridge cloud-design-patterns msmq azure-service-bus nservicebus dotnet-framework circuit-breaker
Hi! Welcome to my blog
.NET, messaging, and distributed systems - the trade-offs the docs leave out.
Form not loading? Subscribe here.