Skip to content

Instantly share code, notes, and snippets.

@jeroenmaes
Created January 25, 2017 19:46
Show Gist options
  • Save jeroenmaes/e1b986b1f2907fb0fc5c0fc18578cf3a to your computer and use it in GitHub Desktop.
Save jeroenmaes/e1b986b1f2907fb0fc5c0fc18578cf3a to your computer and use it in GitHub Desktop.
#r "Microsoft.ServiceBus"
using Microsoft.ServiceBus.Messaging;
using Microsoft.ServiceBus;
using System;
using System.Threading.Tasks;
public static void Run(BrokeredMessage myQueueItem, TraceWriter log, out BrokeredMessage outputSbMsg)
{
var msgBody = GetMessageBodyString(myQueueItem);
log.Info($"MessageBody: {msgBody}");
var result = DecideReprocessNeeded(msgBody);
log.Info($"ReprocessNeeded: {result}");
if(result == true)
{
outputSbMsg = ConstructNewMessage(msgBody);
log.Info($"Message resubmitted to queue.");
}
else
{
outputSbMsg = null;
log.Info($"Message deleted from queue.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment