I would like to know if it is possible to configure an NServiceBus messaging bridge to be one-way only? We have two systems that interacts through MSMQ queue. One of them has been fully migrated to Azure Service Bus transport but there is no plan to update the other one. So I need to bridge messages from one MSMQ queue to one ASB queue but not the other way around.
Alternatively, I could write a small MSMQ application and forward all messages to ASB.
This is good news but it requires NServiceBus 9 which is incompatible with MSQM Transport unless there is a new version coming out soon. As far as I know, MSMQ is not compatible with Net Core or Net projects (only Net Framework).
For some reason, our local nuget feed pass-through didn’t allow me to see NServiceBus.MessagingBridge.Msmq package.
I now have my bridge up and running with the following configuration:
Msmq transport with one endpoint
ASB transport without endpoint
However, I don’t know if my configuration is the right one to enable one-way shoveling (from MSMQ to ASB). I have a ASB endpoint listening to the proxy address mapped in the Bridge so when a message is in the ASQ queue, it is sent back to MSMQ which I don’t want. I only want to achieve MSMQ → ASB.
I am still looking for help here as my current configuration is not working at all. Unless I add an endpoint on my Azure Service Bus transport and register events (from MSMQ endpoint), my events will not be shoveled by the bridge to ASB.
I just tried to get it to work and also failed to succeed. I’ll discuss this internally and try to figure out what the idea was and if I’m also failing to get it to work.
Can you provide more information if you’re seeing exception messages in logfiles or anything and share those? Perhaps you’re even doing something completely different from me.
An NServiceBus messaging bridge can indeed be set up to be one-way only! Without permitting messages to flow backwards, you can configure the bridge to forward messages from an MSMQ queue to an Azure Service Bus (ASB) queue1.
To help you get started, here is a simple example:
Step 1: Prepare Your Space
Set up NServiceBus: Make that NServiceBus and the required transports (Azure Service Bus and MSMQ) are installed.
Establish a Bridge Configuration: In your code, specify the bridge configuration.
Configure the bridge in step two.
Explain what the MSMQ Transport is:
var msmq = new BridgeTransport(new MsmqTransport());
msmq.HasEndpoint("Sales");
Define the Azure Service Bus Transport:
var asb = new BridgeTransport(new AzureServiceBusTransport(connectionString));
asb.HasEndpoint("Billing");
Configure the Bridge with Transports:
var bridgeConfiguration = new BridgeConfiguration();
bridgeConfiguration.AddTransport(msmq);