0

I am using Azure Function EventHub trigger. The messages coming to EH are very critical and we don't want to miss any. If while processing message from my Event Hub, something happens, I write to my retryQueue as follows:

try
{
     await retryQueue.AddAsync (some data from my hub); 
    // if this call also fails, it goes to my catch
}
catch (exception e)
{
    await retryQueue.AddAsync (my eventData); 
    // but what if this call also fails?
}

But what happens when AddAsync() call also fails in my catch block? How and where do I save the message for processing later? Is there such thing as IsTransient (which is available in my Service bus queue)?

khar
  • 201
  • 4
  • 12
  • In theory, if you fall back to the same Storage account that is used to store progress/offsets, they should either both work or both fail. I don't have enough practical experience though. – Mikhail Shilkov Mar 01 '18 at 20:42

1 Answers1

0

Tolerance for duplicates - If check-pointing fails due to timeout/partition least lost not the error in your function code, then the next EventProcessorHost that gets a lease on that partition will start retrieving messages from the last known checkpoint.

Event Hub guarantees at-least-once delivery but not at-most-once delivery.

Azure Functions will not attempt to change that behavior. If not having duplicate messages is a priority, then you will need to mitigate it in your workflow. As such, when check-pointing fails, there are more duplicate messages to manage if your Function is processing messages at batch level.

For more details, refer to this case.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30