简体   繁体   English

天蓝色服务总线继电器断开连接问题

[英]Disconnection issues with azure service bus relay

We are running some long-running test apps with Azure Service Bus relay over http, hosted in a windows service and most of the time, these run fine for 2-3 days. 我们正在运行一些长期运行的测试应用程序,其中Azure Service Bus中继通过http,托管在Windows服务中,大多数情况下,这些应用程序可以运行2-3天。 However every so often an internal network glich may occur (eg firewall reboots) that kills the internet connection. 然而,每隔一段时间内就会发生内部网络glich(例如防火墙重启),这会导致互联网连接中断。

At this point, the relay is dropped in Azure and our web app can no longer communicate with the on-premise service. 此时,中继在Azure中被删除,我们的Web应用程序无法再与内部部署服务通信。

I would have thought that the Azure relay client was fault-tolerant - in that if it realises that it's lost connection with Azure then it will re-establish the connection andf if it can't keep trying until it can.. but it appears that this is not the case. 我原本以为Azure中继客户端是容错的 - 因为如果它意识到它与Azure的连接丢失,那么它将重新建立连接,如果它不能继续尝试直到它可以..但它似乎不是这种情况。 This seems pretty fundamental...? 这似乎很基本......?

Only once have I ever seen a "System.ServiceModel.CommunicationException" where the service can't communicate on the internet, and that was when the client was starting up and trying to establish the connection in the first place. 只有一次我见过“System.ServiceModel.CommunicationException”,其中服务无法在互联网上通信,那就是客户端启动并尝试首先建立连接。

Is there any advice or feedback on handling transient disconnections through the relay service (as it's a cloud --> on-prem direction then the client can't AFAIK ping the server). 有没有关于通过中继服务处理瞬时断开的建议或反馈(因为它是云 - >在本地方向,然后客户端不能AFAIK ping服务器)。

If you are still experiencing issues, you may want to contact Azure support to understand why it is disconnecting. 如果您仍遇到问题,可能需要联系Azure支持以了解其断开连接的原因。 The Relay client should reconnect if something happens to the existing connection. 如果现有连接发生某种情况,则中继客户端应重新连接。

You may want to add ConnectionStatusBehavior to your ChannelFactory to have it output when the status for the connection changes. 您可能希望将ConnectionStatusBehavior添加到ChannelFactory ,以便在连接状态更改时输出它。 It will contain the error that caused it to change status. 它将包含导致其更改状态的错误。

var connectionStatusBehavior = new ConnectionStatusBehavior();
connectionStatusBehavior.Online += ConnectionStatusOnlineMethod;
connectionStatusBehavior.Offline += ConnectionStatusOfflineMethod;
channelFactory.Endpoint.Behaviors.Add(connectionStatusBehavior);

This issue is solved by Microsoft in version 2.6.5 of Microsoft Azure Service Bus dll. Microsoft在Microsoft Azure Service Bus dll的2.6.5版中解决了此问题。 After 1 month of testing it seems to work. 经过1个月的测试,似乎有效。

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

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