0
votes

I am testing an Event Hub. The developers are pushing messages to the Event Hub. I have built an Event Hub Listener to check all the messages are being sent/received correctly. This is the design I used:

https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-dotnet-framework-getstarted-receive-eph

The issue I have is there are circa 4 million events on the event hub and the ProcessEventsAsync method seems to get called 4 or 5 times and then stops being called.

Is there a way I can just request to get only the messages added in the last X minutes?

1

1 Answers

1
votes

Instead of using EventProcessorHost, you could directly read through all the events. That means you would call Receive method directly to read a batch of events.

See Direct consumer and Service Bus Event Hubs Direct Receivers for code examples.

There is no way to filter events by time (last X seconds), offsets are the only addressable space.