Skip to content

Instantly share code, notes, and snippets.

@mslot
Created April 22, 2019 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mslot/2dc4babdc0bb5714edade2c41d7d32b2 to your computer and use it in GitHub Desktop.
Save mslot/2dc4babdc0bb5714edade2c41d7d32b2 to your computer and use it in GitHub Desktop.
[FunctionName("WorkerFunction3")]
public static async Task Function3(
[QueueTrigger("outputQueue")]
CloudQueueMessage item,
[Queue("outputQueue")]
CloudQueue outputQueue,
DateTimeOffset nextVisibleTime,
DateTimeOffset expirationTime,
DateTimeOffset insertionTime,
int dequeueCount,
ILogger log)
{
log.LogInformation("########## Function 3 ###############");
log.LogInformation($"NextVisibleTime: {nextVisibleTime}");
log.LogInformation($"DequeueCount {dequeueCount}");
log.LogInformation($"NextVisibleTime: {(nextVisibleTime - insertionTime).TotalSeconds}");
log.LogInformation($"C# Queue trigger function processed: {item.AsString}");
item.SetMessageContent(item.AsString + " updated");
try
{
throw new Exception();
}
catch (Exception e)
{
throw e;
}
finally
{
await outputQueue.DeleteMessageAsync(item);
await outputQueue.AddMessageAsync(
new CloudQueueMessage(item.AsString),
null, TimeSpan.FromSeconds(60),
null,
null);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment