I want to implement a receiver with EventHubHost inside the Windows Service.
I've tried to do it but for some reason it didn't work.
private void Worker() { var processor = new Processor(); }
The Processor registers the EventProcessor class as:
public Processor() {... _eventProcessorHost.RegisterEventProcessorAsync<EventProcessor>().Wait();... }
the EventProcessor class has the
public class EventProcessor : IEventProcessor { public Task OpenAsync(PartitionContext context) {... Console.WriteLine("EventProcessor Initialized. ...);... }...
public Task ProcessEventsAsync(...)
{... Console.WriteLine("EventProcessor Processing. ...);... }...
and I can see this console message in output.
But the ProcessEventsAsync() with the same Console... it is never called.
What is wrong here?
Maybe it has something with mixing the Windows service and EventHubHost loops?
Leonid Ganeline [BizTalk MVP]