简体   繁体   English

服务总线需要消息

[英]Service bus requiring messages

What is the best way to implement in service bus messages that are requiring once a week or once a day etc. 在需要每周一次或每天一次等的服务总线消息中实现的最佳方法是什么?

I am thinking of having a separate windows service that just drops in messages from the database into the service bus but is there another way? 我正在考虑有一个单独的Windows服务,该服务仅将消息从数据库中放入服务总线中,但是还有另一种方法吗?

In simple terms i want a message that once it is processed, it will appear again in the queue in a specified amount of time to be processed again.Obviously once i process a message i can tell service bus to delete the message or appear again in the queue. 简单来说,我希望消息一旦被处理,就会在指定的时间内再次出现在队列中,以便再次处理。显然,一旦我处理了一条消息,我就可以告诉服务总线删除该消息或再次出现在消息中。队列。

You will need to have some external process (eg your windows service) which sends the message in the first place, on schedule. 您将需要一些外部进程(例如Windows服务),该进程首先按计划发送消息。 You can use Azure Scheduler to do that, see http://www.prasadthinks.com/blog/2015/07/11/azure-scheduler-can-post-to-azure-service-bus-queue-and-topic/ 您可以使用Azure Scheduler来执行此操作,请参阅http://www.prasadthinks.com/blog/2015/07/11/azure-scheduler-can-post-to-azure-service-bus-queue-and-topic/

When you are processing your message, you can do what you are describing ie re-send a copy of the message, using BrokeredMessage.ScheduledEnqueueTimeUtc property so that it arrives at the time you want. 在处理消息时,您可以执行您正在描述的操作,即使用BrokeredMessage.ScheduledEnqueueTimeUtc属性重新发送消息的副本,以便在所需的时间到达。 But I wouldn't do that, does not feel right. 但是我不会那样做,感觉不对。 If you have your external processing already sending messages on schedule, just rely on that 100%. 如果您的外部处理已经按计划发送邮件,则只需依靠该100%。

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

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