延迟接收有关 Azure ServiceBus 主题的消息
Delay receiving a message on an Azure ServiceBus Topic
我在 Azure 服务总线上创建了一个主题,我可以将消息放到它上面,然后取回它们,一切都很好。
但我希望能够将消息放入队列,但以某种方式在订阅上设置过滤器以忽略消息,直到设置 on/within 消息为止。例如:"Here's a item of work, but I don't want you to execute it until 17:00 this evening."
我曾尝试添加一个 SqlFilter,但我迷失了它。我已经根据数字在网上找到了 highMessages 和 lowMessages 的示例,但我无法让它与 SubscriptionClient 一起使用。
这可能吗,还是我只需要延迟将消息添加到队列中,直到我准备好处理它?
过滤器用于根据有关消息的元数据 (headers) 进行过滤,而不是与时钟绑定。听起来您想推迟一条消息。您可以发送消息并将 ScheduledEnqueueTimeUtc
属性 设置为您希望处理消息的任何时间。请注意(引用自MSDN):
Message enqueuing time does not mean that the message will be sent at the same time. It will get enqueued, but the actual sending time depends on the queue's workload and its state.
我在 Azure 服务总线上创建了一个主题,我可以将消息放到它上面,然后取回它们,一切都很好。
但我希望能够将消息放入队列,但以某种方式在订阅上设置过滤器以忽略消息,直到设置 on/within 消息为止。例如:"Here's a item of work, but I don't want you to execute it until 17:00 this evening."
我曾尝试添加一个 SqlFilter,但我迷失了它。我已经根据数字在网上找到了 highMessages 和 lowMessages 的示例,但我无法让它与 SubscriptionClient 一起使用。
这可能吗,还是我只需要延迟将消息添加到队列中,直到我准备好处理它?
过滤器用于根据有关消息的元数据 (headers) 进行过滤,而不是与时钟绑定。听起来您想推迟一条消息。您可以发送消息并将 ScheduledEnqueueTimeUtc
属性 设置为您希望处理消息的任何时间。请注意(引用自MSDN):
Message enqueuing time does not mean that the message will be sent at the same time. It will get enqueued, but the actual sending time depends on the queue's workload and its state.