private async Task ProcessMessageAsync(QueueMessage message) { if (message.DequeueCount >= 5) { await _cloudQueueStorage.SendMessageToPoisonQueueAsync(SCHEDULE_QUEUE_NAME, message); return; } Notification notification = JsonConvert.DeserializeObject <Notification>(message.MessageText); if (notification.ScheduledDateTime.Date != DateTime.UtcNow.Date) { return; } await _notificationPoolRouter.RouteNotificationAsync(notification, false); await _cloudQueueStorage.DeleteMessagesAsync(SCHEDULE_QUEUE_NAME, message); }
public async Task Run([QueueTrigger(NOTIFICATION_POOL_QUEUE_NAME)] string queueMessage) { Notification notification = JsonConvert.DeserializeObject <Notification>(queueMessage); await _notificationPoolRouter.RouteNotificationAsync(notification); }