Beispiel #1
0
 public async Task HandleJob([ServiceBusTrigger("jobs", Connection = "ServiceBusConnectionString")] string myQueueItem, ILogger log)
 {
     try
     {
         var settings = new JsonSerializerSettings {
             TypeNameHandling = TypeNameHandling.All, NullValueHandling = NullValueHandling.Ignore
         };
         var message = JsonConvert.DeserializeObject <Message>(myQueueItem, settings);
         var handler = _messageHandlerFactory.ResolveMessageHandler(message);
         await handler.ProcessAsync(message);
     }
     catch (Exception e)
     {
         log.LogError(e, e.Message);
     }
 }