static WorkInBackgroundController()
        {
            var serviceBusConnectionString = CloudConfigurationManager.GetSetting(ServiceBusConnectionStringKey);

            QueueName = CloudConfigurationManager.GetSetting(ServiceBusQueueNameKey);
            ServiceBusQueueHandler = new ServiceBusQueueHandler(serviceBusConnectionString);
            QueueClient            = ServiceBusQueueHandler.GetQueueClientAsync(QueueName).Result;
        }
Ejemplo n.º 2
0
        public override bool OnStart()
        {
            // Set the maximum number of concurrent connections
            ServicePointManager.DefaultConnectionLimit = 12;

            // Setup the reader
            var serviceBusConnectionString = CloudConfigurationManager.GetSetting(ServiceBusConnectionStringKey);
            var queueName = CloudConfigurationManager.GetSetting(ServiceBusQueueNameKey);
            var serviceBusQueueHandler = new ServiceBusQueueHandler(serviceBusConnectionString);

            _queueClient = serviceBusQueueHandler.GetQueueClientAsync(queueName).Result;

            return(base.OnStart());
        }