0

EventProcessorHost를 사용하여 특정 EventHub 파티션에서 읽을 ServiceFabric Stateless 서비스가 있습니다. 나는이 개 이벤트 허브 파티션 매핑에서 읽고 싶은 일에 각 EventProcessorHostEventProcessorHost를 사용하여 특정 EventHub 파티션에서 읽을 수있는 방법이 있습니까?

먼저 EventHub 파티션 => 첫 EventProcessorHost
둘째 EventHub 파티션 => 두 번째 EventProcessorHost

var eventHubClient = EventHubClient.CreateFromConnectionString(serviceBusConnectionString, eventHubName); 

      // Get the default Consumer Group 
      eventProcessorHost = new EventProcessorHost(Guid.NewGuid().ToString(), 
                 eventHubClient.Path.ToLower(),                
                 consumerGroupName.ToLower(), 
                 serviceBusConnectionString, 
                 storageAccountConnectionString) 
      { 
       PartitionManagerOptions = new PartitionManagerOptions 
       { 
        AcquireInterval = TimeSpan.FromSeconds(10), // Default is 10 seconds 
        RenewInterval = TimeSpan.FromSeconds(10), // Default is 10 seconds 
        LeaseInterval = TimeSpan.FromSeconds(30) // Default value is 30 seconds 
       } 
      }; 

      ServiceEventSource.Current.Message(RegisteringEventProcessor); 
      var eventProcessorOptions = new EventProcessorOptions 
      { 
       InvokeProcessorAfterReceiveTimeout = true, 
       MaxBatchSize = 100, 
       PrefetchCount = 100, 
       ReceiveTimeOut = TimeSpan.FromSeconds(30), 
      }; 
      eventProcessorOptions.ExceptionReceived += EventProcessorOptions_ExceptionReceived; 
      await eventProcessorHost.RegisterEventProcessorFactoryAsync(new EventProcessorFactory<EventProcessor>(deviceActorServiceUri), 
                     eventProcessorOptions); 

답변

0

있는 github의의 환매 특약이 있습니다 here에서 구현할 수있는 구현입니다. 꽤 오랫동안 유지되지 않았지만 문제를 해결하는 것으로 보입니다.

4- 단일 : 단일 이벤트 허브 파티션을 단일 서비스 패브릭 파티션에 매핑합니다. 이벤트 허브 통신 수신기는 제공된 유효한 이벤트 허브 파티션 ID가 필요합니다.

+0

응답을 주셔서 감사합니다.이 솔루션에서는 ** "EventHubReceiver"**를 사용하고 있습니다. 하지만 ** "IEventProcessor"를 사용하여 비슷한 것을 찾고 있습니다 ** –