繁体   English   中英

Azure.Messaging.ServiceBus QueueProperties 属性 DefaultMessageTimeToLive 未正确更新

[英]Azure.Messaging.ServiceBus QueueProperties property DefaultMessageTimeToLive not updating correctly

我正在尝试利用 Azure 服务总线队列的生存时间属性来清除队列(如果已备份)。 我一直在尝试使用队列上的 DefaultMessageTimeToLive 属性通过将其设置为一秒来执行此操作

private static ServiceBusAdministrationClient client = new ServiceBusAdministrationClient(Environment.GetEnvironmentVariable("ServiceBusNamespaceConnectionString"));
QueueProperties properties = await client.GetQueueAsync(queueName);
properties.DefaultMessageTimeToLive = new TimeSpan(0, 0, 5);

但是,执行此代码后,TimeSpan 在 Azure 门户上保持不变,并且没有消息过期。 我猜是因为设置只是在本地设置。 我将如何在实际队列本身上设置这些更改?

对于遇到此问题的任何其他人,请使用 UpdateQueueAsync 调用来执行此操作。

暂无
暂无

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

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