NServiceBus One-way bridge (msmq to ASB)

Hi,

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.

Regards,
Michel

Good day, @Michel_Deblois.

The bridge supports one-way shoveling, starting with version 4.0.1.

.m

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).

Thanks
Michel

@Michel_Deblois NServiceBus 9 is not compatible with MSMQ transport but we did make the Messaging Bridge support MSMQ.

Ok. How can I achieve this if MessagingBridge 4.0.1 requires Net 8 and depends on NServicebus 9 while Msmq transport depends on NServicebus 8…

There might be a new nuget or a different way to setup the latest version of Messaging Bridge but I can’t find it in the documentation.

Thank you
Michel

You don’t use NServiceBus.Transport.Msmq, you use NServiceBus.MessagingBridge.Msmq

We have this illustrated in a sample:

Should NServiceBus.MessagingBridge.Msmq be called out in the docs for the messaging bridge targeting NSB 9 here?

Thanks for the replies.

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 have the same query! Did you get the solution for this?

Hi,

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.

Thanks

Hi @Michel_Deblois and @kirkkatina

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.

Regards,
Dennis

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);