Is it possible to set a recurring schedule for message delivery via MassTransit running on Service Bus?
If so, is there any example code available?
Or is it better to build a service similar to a Quartz Scheduler service but target Azure Scheduler?
Is it possible to set a recurring schedule for message delivery via MassTransit running on Service Bus?
If so, is there any example code available?
Or is it better to build a service similar to a Quartz Scheduler service but target Azure Scheduler?
Copyright © 2021 Jogjafile Inc.
If you are using Azure, you have three options,
In Azure Logic Apps, you can build a workflow to migrate the date via "recurrence" trigger.
In Azure Functions you can use Timer Trigger and write your own logic using Azure Service Bus SDK / REST API. You can find more information about Timer Trigger here for C# script, but you can also use JS, F#, etc. In case you are going with Azure Function, if the scheduled time is every 5 minutes, the
function.jsonwill be coded like belowThe code for the function will be something like below
I am using the .NET SDK for Azure Service Bus, you can find the reference here. If you are new to Azure Functions, the C# scripting function works slightly in a different way. The approach of referencing a dll is different. You can find it here.
When it comes to Azure Web Jobs, its running as a part of Azure Web apps. For Azure Web Job, you can write a webjob using a console application template as well. You can use the same Azure Service Bus SDK mentioned above for the development of the Web Job as well. Find the documentatio of Azure Web Jobs here.