在python中创建Azure Service Bus队列时使用autoDeleteOnIdle [英] Use autoDeleteOnIdle when creating Azure Service Bus Queue in python

查看:166
本文介绍了在python中创建Azure Service Bus队列时使用autoDeleteOnIdle的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用azure.servicebus软件包来管理应用程序中的一些队列.我想在我在代码中创建的队列上设置autoDeleteOnIdle属性.有可能做到吗?

I'm using azure.servicebus package to manage some queues in my application. I'd like to set the autoDeleteOnIdle property on the queues I create in my code. Is it possible to do it?

我尝试过:

queue_options = Queue()
queue_options.auto_delete_on_idle = auto_delete_on_idle_delay
queue_options.default_message_time_to_live = default_message_ttl
self.bus_service.create_queue(队列名称=队列名称,队列=队列选项,fail_on_exist = fail_on_exist)

queue_options = Queue()
queue_options.auto_delete_on_idle = auto_delete_on_idle_delay
queue_options.default_message_time_to_live = default_message_ttl
self.bus_service.create_queue(queue_name=queue_name, queue=queue_options, fail_on_exist=fail_on_exist)

default_message_time_to_live似乎可以正常工作,但是似乎没有使用auto_delete_on_idle.

The default_message_time_to_live seems to work fine but the auto_delete_on_idle doesn't seem to be used.

我还查看了REST API,那里似乎也没有公开autoDeleteOnIdle.我无法使用.NET,使用此功能有哪些选择?

I also looked at the REST API and the autoDeleteOnIdle doesn't seem to be exposed there either. I can't use .NET, what are my options to use this feature?

谢谢!

推荐答案

<一个href ="https://docs.microsoft.com/zh-cn/dotnet/api/microsoft.servicebus.messaging.queuedescription.autodeleteonidle?view=azure-dotnet"> AutoDeleteOnIdleProperty   –实际上是 一个时间跨度,它表示队列在空闲后可以存活多长时间,然后自动将其删除.最小时间为5分钟.

AutoDeleteOnIdleProperty – This is actually a timespan which denotes how long a queue can stay alive once it is idle before it is automatically deleted. The minimum time is 5mins.

有关更多详细信息,请参阅"

For more details, refer "When will you need this feature?".

免责声明:

Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

---------------------- -------------------------------------------------- -----------------------

如果此答案有帮助,请单击标记为答案"或投票".要提供有关您的论坛体验的其他反馈,请单击 span /p>

If this answer was helpful, click "Mark as Answer" or "Up-Vote". To provide additional feedback on your forum experience, click here


这篇关于在python中创建Azure Service Bus队列时使用autoDeleteOnIdle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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