简体   繁体   中英

How to access MSMQ in C# behind load balancer (F5)

My issue is that I cannot access the MSMQ that is hosted on a Windows Server 2012 box that is behind an F5 load balancer. I am using the load balancer in an active/passive state to ensure availability.

I can access the MSMQ just fine when using the server name directly in the connection string but I cannot when I use the F5 VIP.

The following works:

FormatName:DIRECT=OS:<servername>\Private$\myQueueName

This however does not:

FormatName:DIRECT=OS:<F5 VIP>\Private$\myQueueName

I've also attempted to read the message queue using TCP to no avail:

FormatName:DIRECT=TCP:<servername>\Private$\myQueueName

There is no MSMQ aware load balancer. F5 also cannot achieve that for direct queuing to servers. Since MSMQ works with multiple ports for its communication back and forth.

You can try the http option of MSMQ. That can be Network Load Balanced and communicates with single port.

NserviceBus has Nservicebus.Gateway which simplifies this solution. You can also use Distributor from Nservicebus to load balance amonst it workers. Nservicebus does not recommend it for load balancing, recommends only to use across wan networks.

Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM