You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RetryDelegatingHandler is not used when using IHttpClientFactory. In order to manually register it, it requires that the base DelegatingHandler class have it default ctor called which is not the case with the current implementation.
publicRetryDelegatingHandler(ReliabilitySettings settings)// remove this line// : this(new HttpClientHandler(), settings){// add this linethis.settings =settings;}
Was there a specific reason to create an HttpClientHandler? If so, maybe need a InjectableRetryDelegatingHandler class specific for this use case.
Or is there any other option for this? The only other option I can think of is to make my own retry handler or use Polly but I would prefer to use the one created specifically by SendGrid for SendGrid. Seems reasonable to expect this to work.
Exception/Log
The 'InnerHandler' property must be null. 'DelegatingHandler' instances provided to 'HttpMessageHandlerBuilder' must not be reused or cached. Handler: 'SendGrid.Helpers.Reliability.RetryDelegatingHandler'
The text was updated successfully, but these errors were encountered:
I think the refactor suggested is fine. The HttpClientHandler can be created 1 level up (which is what's done when dealing with an IWebProxy). I'll work on an update.
Issue Summary
The RetryDelegatingHandler is not used when using IHttpClientFactory. In order to manually register it, it requires that the base DelegatingHandler class have it default ctor called which is not the case with the current implementation.
This is what I'm trying to do...
Steps to Reproduce
Changes that would fix this is to call base default ctor instead of creating a new HttpClientHandler.
Change this line to the below:
Was there a specific reason to create an HttpClientHandler? If so, maybe need a InjectableRetryDelegatingHandler class specific for this use case.
Or is there any other option for this? The only other option I can think of is to make my own retry handler or use Polly but I would prefer to use the one created specifically by SendGrid for SendGrid. Seems reasonable to expect this to work.
Exception/Log
The text was updated successfully, but these errors were encountered: