Exemplo n.º 1
0
        public JobPerformer(ServiceLogger log)
        {
            var eventHubName     = ConfigurationManager.AppSettings["EventHubName"];
            var connectionString = ConfigurationManager.AppSettings["EventHubConnectionString"];
            var eventHub         = EventHubClient.CreateFromConnectionString(connectionString, eventHubName);

            eventHubClient = new MeteredEventHubClient(eventHub, 838861 * 11 / 10, TimeSpan.FromSeconds(1));
            Log            = log;
            log.LogInfo("Exception", String.Empty);
        }
Exemplo n.º 2
0
        public QueueReader(ServiceLogger log, JobPerformer performer)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);

            // Create the queue client
            CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();

            var queueName = ConfigurationManager.AppSettings["QueueName"];

            // Retrieve a reference to a queue
            _queue     = queueClient.GetQueueReference(queueName);
            _performer = performer;
            _watch     = new AverageStopWatch();
            _log       = log;
            log.LogInfo("QueueName", queueName);
        }