Last active
September 21, 2019 22:54
-
-
Save ankitvijay/0ba925e99710f83fc8b997e12e37660b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Extensions.Logging; | |
namespace DemoNServiceBusSubscriberAndAzureFunctionPublisher | |
{ | |
public static class TimerTriggerAzureFunction | |
{ | |
[FunctionName("QueueMessageToWorker")] | |
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, | |
[ServiceBus("%AzureServiceBusQueue%", Connection = "AzureServiceBusConnectionString")] | |
ICollector<ExecuteSomeCommand> collectors, | |
ILogger log) | |
{ | |
collectors.Add(new ExecuteSomeCommand(Guid.NewGuid().ToString())); | |
} | |
} | |
public class ExecuteSomeCommand | |
{ | |
public ExecuteSomeCommand(string id) | |
{ | |
Id = id; | |
} | |
public string Id { get; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment