public void Initialize(EventHubConsumerGroup sender, string[] partitionIds) { Consumer = sender; PartitionIds = partitionIds; foreach (var item in partitionIds) { sender.RegisterProcessor <NotificationProcessor <T> >(EventProcessorCheckpointHelper.GetLease(GetType().Name, sender.EventHubPath, item), new EventProcessorCheckpointManager()); } }
private void ShutdownEventPump() { try { foreach (var partitionId in PartitionIds) { Logging.DebugMessage(string.Format("Shutting down processor {0}", partitionId)); Consumer.UnregisterProcessor(EventProcessorCheckpointHelper.GetLease(GetType().Name, Consumer.EventHubPath, partitionId), CloseReason.Shutdown); } Consumer.Close(); Consumer = null; Logging.DebugMessage("Shutdown completed"); } catch (Exception ex) { Logging.Exception(ex); } }