[英]using an Azure Service Bus Queue and BrokeredMessage.ScheduledEnqueueTimeUtc to renew subscriptions
I have a subscription model, and want to perform renew-related logic like issue new invoice, send emails, etc. For example, user would purchase the subscription today, and the renewal is in a year's time. 我有一个订阅模型,并希望执行与续订相关的逻辑,如发出新发票,发送电子邮件等。例如,用户今天将购买订阅,续订是在一年的时间。 I've been using an Azure Queue recently, and think it would apply for such a renewal.
我最近一直在使用Azure Queue,并认为它适用于这样的续订。
Is it possible to use the Azure Queue by pushing messages using BrokeredMessage.ScheduledEnqueueTimeUtc
( http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.brokeredmessage.scheduledenqueuetimeutc.aspx ) for such long term scheduled messages? 是否可以通过使用
BrokeredMessage.ScheduledEnqueueTimeUtc
( http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.brokeredmessage.scheduledenqueuetimeutc.aspx )推送消息来使用Azure队列来获取此类长期计划消息?
I've used it for shorter-term, like sending notifications in 1 minute time and it works great. 我已经将它用于短期,比如在1分钟内发送通知,效果很好。
This way, I can have even multiple processes listening to the queue, and be sure that only one process would perform the renewal logic. 这样,我甚至可以有多个进程监听队列,并确保只有一个进程可以执行更新逻辑。 This would solve a lot of locking-related problems, as that is kind of built-in the Azure Queue via leasing and related features.
这将解决许多与锁相关的问题,因为这是通过租赁和相关功能内置Azure Queue。
Yes, you can use it for long-term scheduling, scheduled messages have the same guaranties as normal ones. 是的,您可以将其用于长期调度,预定的消息与普通消息具有相同的保证。 But there are few things you need to be aware of:
但是你需要注意的事情很少:
ScheduledEnqueueTimeUtc
is a time when message is going to be available (within hundreds of miliseconds) on the queue but not necessary delivered, this depends on load and state of the queue. ScheduledEnqueueTimeUtc
是消息在队列上可用(在几百毫秒内)但不必传递的时间,这取决于队列的负载和状态。 So it's fine for business processes but not for time sensitive (milliseconds) usage. ScheduledEnqueueTimeUtc
, they are invisible. ScheduledEnqueueTimeUtc
之前访问预定的消息,它们是不可见的。 Extremely awesome source of informations on azure messaging 关于天蓝色消息传递的非常棒的信息来源
From technological perspective it's fine but in your case I would also think about other potential problems if you think about years: 从技术角度看它很好,但在你的情况下,如果考虑多年,我也会考虑其他潜在的问题:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.