删除Azure Service Bus中的无效主题 [英] Deleting dead topics in Azure Service Bus

查看:77
本文介绍了删除Azure Service Bus中的无效主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已尝试就此问题进行功课,但我无法进行的任何搜索都使我更加接近答案.最热门的是检测并删除孤立队列,主题或Azure Service Bus上的订阅.

I've tried to do my homework on this issue but no searches I can make have gotten me closer to the answer. Closest hit was Detect and Delete Orphaned Queues, Topics, or Subscriptions on Azure Service Bus.

我的情况:

我正在运行多个服务(标准Win服务).在启动时,这些过程开始订阅Azure Service Bus中的给定主题.让我们将主题称为消息".

I have multiple services running (standard win service). At startup these processes starts to subscribe to a given topic in Azure Service Bus. Let's call the topic "Messages".

当服务关闭时,它会以一种不错的方式退订.

When the service is shut down it unsubcribes in a nice way.

但是有时会发生某些事情并且服务崩溃,从而导致取消订阅失败,然后使订阅挂起.

But sometimes stuff happens and the service crashes, causing the unsubscription to fail and the subscription then is left hanging.

我的问题:

1)从我所看到的内容中,每个死主题的订阅都在向该主题发送消息时进行计数.即使没有人会去捡它.事实还是虚构?

1) From what I'm seeing, each dead topic subscription counts when a message is sent to that topic. Even if no one is ever going to pick it up. Fact or fiction?

2)无论如何,是否有一段时间未检查的订阅会被删除,例如最近24小时?最好使用Power Shell脚本?

2) Is there anyway to remove subscriptions that haven't been checked for a while, for example for the last 24h? Preferrably by a Power Shell script?

我直接向Microsoft提出了此问题,但尚未收到任何答案.当然,我不能成为第一个体验这一点的人.如果有任何第三方信息,我也会进行更新.

I've raised this issue directly with Microsoft but haven't received any answer yet. Surely, I can't be the first to experience this. I'll also update this if I get any third party info.

谢谢

Johan

推荐答案

在您的1)问题上,是的,发送到主题的消息将被发送到任何匹配的订阅,即使该订阅是空闲的(根据您自己的逻辑).订阅是您创建的永久工件,即使没有服务使消息出队,也可以打开以接收消息.

On your 1) question, yes messages sent to a topic will be sent to any matching subscription, even if that is Idle (based on your own logic). A subscription is a permanent artifact that you create that is open to receive messages, even when no services are dequeuing messages.

要清除订阅,您可能可以使用SubscriptionDescription的AccessedAt属性,并使用该属性检查有人最后一次读取队列的时间(通过Receive操作). http://msdn.microsoft.com/en -us/library/microsoft.servicebus.messaging.subscriptiondescription.accessedat.aspx

To clean out subscriptions, you can probably use the AccessedAt property of the SubscriptionDescription and use that to check when someone last read the queue (by a Receive operation). http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.subscriptiondescription.accessedat.aspx

如果使用该逻辑,则可以构建自己的清理"机制

If you use that logic, you can build your own 'cleansing' mechanisms

HTH

这篇关于删除Azure Service Bus中的无效主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆