title: Should I put my events inside a queue after getting them from Azure Event Hub?
body: <p>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:</p>
  
  <ul>
  <li>a Stream Analytics task for real-time analysis</li>
  <li>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).</li>
  </ul>
  
  <p>I'm currently using the <a href="https://www.nuget.org/packages/Microsoft.Azure.ServiceBus.EventProcessorHost" rel="noreferrer">EventProcessorHost</a> library to retrieve my events from the Event Hub inside my worker role.</p>
  
  <p>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 <strong>I shouldn't do a lot of processing after retrieving <code>EventData</code> events from my Event Hub</strong>.</p>
  
  <p>Specifically :</p>
  
  <ul>
  <li><a href="http://blogs.msdn.com/b/servicebus/archive/2015/01/16/event-processor-host-best-practices-part-1.aspx" rel="noreferrer">http://blogs.msdn.com/b/servicebus/archive/2015/01/16/event-processor-host-best-practices-part-1.aspx</a></li>
  </ul>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <ul>
  <li><a href="http://blogs.msdn.com/b/musings_on_alm_and_software_development_processes/archive/2014/09/03/azure-event-hubs-queues-and-workers.aspx" rel="noreferrer">http://blogs.msdn.com/b/musings_on_alm_and_software_development_processes/archive/2014/09/03/azure-event-hubs-queues-and-workers.aspx</a></li>
  </ul>
  
  <blockquote>
    <p>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).</p>
  </blockquote>
  
  <p>So the question is: <strong>should I do all my processing stuff directly after the Event Hub</strong> (i.e. inside the <code>ProcessEventsAsnyc</code> method of my <a href="https://msdn.microsoft.com/en-us/library/hh435336.aspx" rel="noreferrer"><code>IEventProcessor</code></a> implementation), <strong>or should I use a queue between the Event Hub and the processing stuff</strong>?</p>
  
  <p>Any recommendation about how to properly consume events from an Event Hub would be appreciated, the documentation is currently a bit... missing.</p>