I'm currently developing an application hosted on Azure that uses Azure Event Hub. Basically I'm sending messages (or should I say, events) to the Event Hub from a Web API, and I have two listeners:
- a Stream Analytics task for real-time analysis
- a standard worker role that computes some stuff based on the received events and then stores them into an Azure SQL Database (this is a lambda architecture).
I'm currently using the EventProcessorHost library to retrieve my events from the Event Hub inside my worker role.
I'm trying to find some best practices about how to use the Event Hub (it is a bit harder to use Event Hubs than service bus queues, i.e. streaming vs message consuming), and I found some people saying I shouldn't do a lot of processing after retrieving EventData
events from my Event Hub.
Specifically :
Keep in mind you want to keep whatever it is you're doing relatively fast - i.e. don't try to do many processes from here - that's what consumer groups are for.
The author of this article added a queue between the Event Hub and the worker role (it's not clear from the comments if it's really required or not).
So the question is: should I do all my processing stuff directly after the Event Hub (i.e. inside the ProcessEventsAsnyc
method of my IEventProcessor
implementation), or should I use a queue between the Event Hub and the processing stuff?
Any recommendation about how to properly consume events from an Event Hub would be appreciated, the documentation is currently a bit... missing.