示例#1
0
 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());
     }
 }
示例#2
0
 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);
     }
 }
 public Task CheckpointAsync(Lease lease, string offset, long sequenceNumber)
 {
     return(EventProcessorCheckpointHelper.CheckpointAsync(Namespace, EventHub, lease, offset, sequenceNumber));
 }