简体   繁体   English

Azure服务总线主题,订阅丢失

[英]Azure Service Bus Topics, Subscription Lost

I'm working with Azure ServiceBus, standard tier. 我正在使用Azure ServiceBus(标准层)。

I'm trying to figure out what's happened since a couple of weeks, (it seems it started when bus traffic has increased, maybe 10-15 messages per second). 我试图弄清楚几周后发生了什么(似乎是从总线流量增加开始,可能是每秒10-15条消息开始)。

I have automatic creation of subscription using 我使用以下方式自动创建了订阅

subscriptionOpts.AutoDeleteOnIdle = TimeSpan.FromHours(3);

Starting from lasts weeks, (when we got a traffic increment), sometimes our subscriptionclients stopped receiving messages and after 3 hours they get deleted. 从过去的几周开始((当我们获得流量增加时)),有时我们的订阅客户端会停止接收消息,并在3小时后被删除。

var messageOptions = new MessageHandlerOptions(args =>
    {
         Emaillog.Warn(args.Exception, $"Client ExceptionReceived: {args.Exception}");
         return Task.CompletedTask;
    }) { AutoComplete = true };
_subscriptionClient.RegisterMessageHandler(async (message, token) => await OnMessageReceived(message, $"{_subscriptionClient.SubscriptionName}", token), messageOptions);

Is it possible that a subscription client gets disconnected and doesn't connect anymore? 订阅客户端是否有可能断开连接并且不再连接? I have 4-5 clients processes that connect to this topic, each one with his own subscription. 我有4-5个与该主题相关的客户端进程,每个进程都有自己的订阅。 When I find one of these subscriptions deleted, sometimes they have all been deleted, sometimes only some of them have been deleted. 当我发现其中一个订阅已删除时,有时它们已全部删除,有时只删除了其中一些。

Is it a bug? 是虫子吗? The only method call I do on the subscriptionClient is RegisterMessageHandler. 我对subscriptionClient进行的唯一方法调用是RegisterMessageHandler。 I don't manage manually anything else... 我什么都不做

Thank you in advance 先感谢您

The property AutoDeleteOnIdle is used to delete the Subscription when there is no message processing with in the Subscription for the specified time span. 如果在指定时间内在订阅中没有使用消息进行处理,则使用属性AutoDeleteOnIdle删除订阅。

As you mentioned that the message flow increased to 15 messages per second, there is no chance that the Subscription is left empty (with out message flow). 正如您提到的那样,消息流增加到每秒15条消息,因此,订阅没有任何机会留空(没有消息流)。 So there is no reason for the Subscriptions to delete. 因此,没有理由删除订阅。 The idleness of the Subscription is decided by both incoming and outgoing messages. 订阅的空闲状态由传入和传出消息共同决定。

There can be chances that due to heavy message traffic, the downstream application processing the messages may went offline, leaving the messages unprocessed, eventually when the message flow reduced there is no receiver to process the messages, leaving the Subscription idle for 3 hours and delete. 有可能由于消息通信量大,处理消息的下游应用程序可能会脱机,从而使消息未得到处理,最终,当消息流减少时,没有接收者可以处理消息,从而使订阅空闲3小时并删除。

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

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