Exemplo n.º 1
0
 public async Task Run([EventHubTrigger(EventHubsConstants.Hubs.CosmosDbDiagnostics, Connection = EventHubsConstants.ConnectionStringConfigurationKey)] EventData[] events)
 {
     try
     {
         await _scalingService.ScaleUp(events);
     }
     catch (NonRetriableException nrEx)
     {
         _logger.Error(nrEx, $"An error occurred processing messages on event hub: {EventHubsConstants.Hubs.CosmosDbDiagnostics}");
     }
     catch (Exception exception)
     {
         _logger.Error(exception, $"An error occurred processing messages on event hub: {EventHubsConstants.Hubs.CosmosDbDiagnostics}");
         throw;
     }
 }
 public async Task Run([ServiceBusTrigger(
                            ServiceBusConstants.TopicNames.JobNotifications,
                            ServiceBusConstants.TopicSubscribers.ScaleUpCosmosdbCollection,
                            Connection = ServiceBusConstants.ConnectionStringConfigurationKey)] Message message)
 {
     if (_featureToggle.IsCosmosDynamicScalingEnabled())
     {
         try
         {
             _correlationIdProvider.SetCorrelationId(message.GetCorrelationId());
             await _scalingService.ScaleUp(message);
         }
         catch (Exception exception)
         {
             _logger.Error(exception, $"An error occurred getting message from queue: {ServiceBusConstants.TopicSubscribers.ScaleUpCosmosdbCollection}");
             throw;
         }
     }
 }
Exemplo n.º 3
0
        public async Task Run([EventHubTrigger(EventHubsConstants.Hubs.CosmosDbDiagnostics, Connection = EventHubsConstants.ConnectionStringConfigurationKey)] EventData[] events)
        {
            try
            {
                _correlationIdProvider.SetCorrelationId(Guid.NewGuid().ToString());

                await _scalingService.ScaleUp(events);

                _logger.Information("Generate allocations complete");
            }
            catch (NonRetriableException nrEx)
            {
                _logger.Error(nrEx, $"An error occurred processing messages on event hub: {EventHubsConstants.Hubs.CosmosDbDiagnostics}");
            }
            catch (Exception exception)
            {
                _logger.Error(exception, $"An error occurred processing messages on event hub: {EventHubsConstants.Hubs.CosmosDbDiagnostics}");
                throw;
            }
        }