Created
April 22, 2019 08:21
-
-
Save mslot/2dc4babdc0bb5714edade2c41d7d32b2 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
[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