c# - 如何取消 Azure 主题中的预定消息

标签 c# azure azureservicebus

As the title says, Is it possible to cancel scheduled message delivery to a topic?

背景:

我正在使用message scheduling在主题中。我一般安排在 10 分钟后发送消息。 效果很好。基于某些业务逻辑,我需要取消预定的消息。可行吗?

最佳答案

从版本 3.3.1 开始,您现在可以执行此操作。

var sequenceNumber = await queueClient.ScheduleMessageAsync(message, DateTimeOffset.UtcNow.AddSeconds(300)).ConfigureAwait(false);
await queueClient.CancelScheduledMessageAsync(sequenceNumber).ConfigureAwait(false);

关于c# - 如何取消 Azure 主题中的预定消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27144677/

相关文章:

c# - 我如何组合 Expression<Func<MyClass,bool>>[]?

c# - Tag Helper - 添加集合中的所有属性

python - 我想从 python 中的 azure 函数应用程序创建 Azure 容器实例 (ACI)

azure - Azure 应用服务计划中用于前端和后端通信的负载平衡设置

.net - Azure 服务总线将获取请求添加到队列

作为 Google PubSub 推送订阅者的 Azure 服务总线主题

c# - Elasticsearch索引文档,但下一个查询返回0个匹配

c# - 目标确实存在时出现 StyleCop CA0055 问题

c#-4.0 - Windows Azure 模拟器 "Invalid access to memory location."

java - 如何获取 json 格式的 Azure 服务总线队列响应