public QueueMessageReceiver() { string connectionString = ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"]; const string QueueName = "AgentsQueue"; this.messagesQueueClient = new MessagesQueueClient<AgentUpdateMessage>(connectionString, QueueName); this.messagesQueueClient.Subscribe(ProcessMessage); }
protected override void OnStart(string[] args) { this.messagesQueueClient = new MessagesQueueClient<AgentUpdateMessage>( this.agentServiceSettings.QueueConnectionString, this.agentServiceSettings.QueueName); this.timer = new Timer(this.agentServiceSettings.TimerInterval); this.timer.Elapsed += this.TimerOnElapsed; this.timer.Start(); }