title: Exception handling in a batch of Event Hub events using Azure WebJobs Sdk
body: <p>I use the EventHub support of the Azure WebJobs Sdk to process Events. Because of the throughput I decided to go for batch processing of those Events, e.g. my method looks like this:</p>
  
  <pre><code>public static void HandleBatchRaw([EventHubTrigger("std")] EventData[] events) {...}
  </code></pre>
  
  <p>Now one of those events within a batch might cause an Exception - what's the right way to handle that? When I leave the Exception uncaught the processing stops and the remainder of the Events in the EventData[] parameter get lost. </p>
  
  <p>Options: </p>
  
  <ol>
  <li>Catch the Exception manually, forward the Event to some place
  else and continue </li>
  <li>Let the SDK do the magic, e.g. it should just
  'ACK' the Events processed until then (I probably would have to do that), mark this event as 'Poisoned', exit the method and continue on the next call of the function. </li>
  <li>Move to Single Event Handling - but for performance
  goals I don't feel that's right</li>
  <li>I missed the point and should think of another strategy</li>
  </ol>
  
  <p>How should I approach this?</p>