在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?

谢谢!

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