简体   繁体   English

如何在负载均衡器后面的C#中访问MSMQ(F5)

[英]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. 我的问题是我无法访问F5负载均衡器后面的Windows Server 2012上托管的MSMQ。 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. 在连接字符串中直接使用服务器名称时,我可以访问MSMQ,但是当我使用F5 VIP时,我无法访问MSMQ。

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: 我也尝试使用TCP读取消息队列无济于事:

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

There is no MSMQ aware load balancer. 没有MSMQ感知负载均衡器。 F5 also cannot achieve that for direct queuing to servers. F5也无法实现直接排队到服务器。 Since MSMQ works with multiple ports for its communication back and forth. 由于MSMQ使用多个端口进行来回通信。

You can try the http option of MSMQ. 您可以尝试MSMQ的http选项。 That can be Network Load Balanced and communicates with single port. 这可以是网络负载平衡并与单个端口通信。

NserviceBus has Nservicebus.Gateway which simplifies this solution. NserviceBus有Nservicebus.Gateway,它简化了这个解决方案。 You can also use Distributor from Nservicebus to load balance amonst it workers. 您还可以使用Nservicebus中的Distributor来为工作人员进行负载均衡。 Nservicebus does not recommend it for load balancing, recommends only to use across wan networks. Nservicebus不建议将其用于负载平衡,建议仅在wan网络中使用。

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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