So the scenario is that I\'m using an SB queue to throttle outgoing callbacks to other services. One of the standard problems with calling back to other services is that the
Feels a bit hacky, but the solution I came up with is
try
{
...
}
catch (Exception ex)
{
await Task.Delay(30000);
throw;
}
This way it will wait for 30 seconds before allowing it to abandon. It will eventually dead letter after the configured amount of times.
I am using Azure Webjobs for receiving.
Although I am using Task.Delay instead of Thread.Sleep it doesn't seem to be freeing up the thread to process another item from the queue while it awaits (by default, Webjobs processes 16 in parallel).