I expect the following code to retry forever, but it consistently throws an exception after ~40 seconds of being disconnected from the network -- which is the best I can do to simulate transient Internet connection or Event Hub outages.
var eventHubClient = EventHubClient.CreateFromConnectionString(…);
eventHubClient.RetryPolicy = new RetryExponential(
TimeSpan.FromSeconds(5), // minBackoff
TimeSpan.FromMinutes(2), // maxBackoff
Int32.MaxValue); // maxRetryCount
…
eventHubClient.SendAsync(…).Wait();
What's going on here?
I'm using the WindowsAzure.ServiceBus
NuGet package, version 4.1.10 on .NET Framework 4.6. I'm willing to change either package or framework if needed.