0
votes

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?

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.

1
Can you please explain what you mean by messages that are requiring once a week or once a day etc.? - Gaurav Mantri

1 Answers

0
votes

You will need to have some external process (e.g. your windows service) which sends the message in the first place, on schedule. 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/

When you are processing your message, you can do what you are describing i.e. re-send a copy of the message, using BrokeredMessage.ScheduledEnqueueTimeUtc property so that it arrives at the time you want. 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%.