Skip to main content
Filter by
Sorted by
Tagged with
1 vote
1 answer
319 views

I'm inspecting some code that seems to throw System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at times. We use the library Polly for auto retries for ...
mint's user avatar
  • 3,433
-1 votes
1 answer
521 views

I'm using Polly to send https requests to an external server, the problem is the ServerCertificateCustomValidationCallback is never invoked: public class CustomeHttpClient : HttpClientHandler { ... ....
Arh Hokagi's user avatar
2 votes
1 answer
1k views

I would like to understand how to implement an optimistic timeout policy with Polly by using the HttpClientFactory. In the examples on the net, the timeout policy is used when calling asynchronous ...
alex's user avatar
  • 131
-1 votes
1 answer
2k views

I'm sending data to a databricks api with a bad bearer token to test a Polly retry policy, but I get this exception: InvalidOperation exception: The request message was already sent. Cannot send the ...
Salvatore Allegra's user avatar
3 votes
1 answer
2k views

We started using the Polly library in our legacy WinForms project which still runs on the .NET 4.0 framework (is a requisite). The problem is that we have to use version 4.3 of the Polly library and ...
Michele Massari's user avatar
3 votes
1 answer
693 views

I've been reading this which seems to have a way of doing what I want. I've got something similar obviously, but within the PolicyContextExtensions the context.TryGetValue takes PolicyContextItems. ...
sr28's user avatar
  • 5,258
4 votes
1 answer
7k views

I create a HTTP Client using IHttpClientFactory and attach a Polly policy (requires Microsoft.Extensions.Http.Polly) as follows: using Microsoft.Extensions.Hosting; using Microsoft.Extensions....
quervernetzt's user avatar
5 votes
1 answer
8k views

I've created a retry policy on my HttpClient in the Startup.ConfigureServices method. Note also that by default, asp.net core 2.1 logs 4 [Information] lines for each call made by the HttpClient which ...
SeanOB's user avatar
  • 782
1 vote
0 answers
648 views

Wanted to verify if HttpCLient instance should be created outside method passed to polly for ExecuteAsync, or in? My current usage varies between the two options and I am not sure which is the correct ...
o_w's user avatar
  • 691
4 votes
1 answer
2k views

What's the correct way to modify the Duration Break on Polly? I know in the documentation they mention implementing (PolicyRegistry). Is there any example of this? I was implementing Polly ...
Felipe Alves de Lima's user avatar
1 vote
2 answers
3k views

I want to use Polly in conjunction with my HttpClientFactory (in my C# .NET 5.0 project). But the problem I have is that I have multiple named HttpClients in my factory and what I am trying to achieve ...
frankhommers's user avatar
  • 1,375
1 vote
1 answer
2k views

In my Startup.cs I have the following lines of code: services.AddHttpClient<CustomClientFactory>() .AddTransientHttpErrorPolicy( p => p.WaitAndRetryAsync(3, ...
Riko Hamblin's user avatar
3 votes
1 answer
4k views

I have a refit client (IMyRefitClient) that returns Task<ApiResponse<ADomainModel>> I can't inject this refit client in Program.cs with HostBuilder.ConfigureServices because the url isn't ...
Jack's user avatar
  • 307
1 vote
1 answer
961 views

So I have 2 queries: var a = await _aQuery.Execute(aId); var b = await _bQuery.Execute(bId); How can I retry execution of these queries with Polly Retry so that if any of them succeeds to get a non-...
tad's user avatar
  • 31
3 votes
1 answer
4k views

I have never used Polly before and am not sure if this is a good scenario for Polly. I am calling an endpoint with a list of 1000 DTO in the POST body. Now the endpoint will perform some validations ...
ravi kumar's user avatar
  • 1,650
3 votes
0 answers
2k views

I'm using the RabbitMQ.Client nuget package to publish messages to rabbitmq from a .NET core 3.1 application. We are using the 5.1.0 version of the library. We want to improve the resiliency of our ...
Enrico Massone's user avatar
-1 votes
1 answer
1k views

Below code re-try 2 times when we have error from HttpRequestException, 5XX and 408 and it's works fine. Here I want to re-try for even 401 error? how we can achieve this with Polly? services....
user584018's user avatar
  • 11.5k
1 vote
0 answers
1k views

I am searching on the internet to find a code example in .NET for implementing a kafka retry policy with publishing failed messages to a Dead Letter Topic (DLT/DLQ), but I can't find an example. Does ...
J Vijverberg's user avatar
2 votes
1 answer
3k views

I am trying to get Polly to try again on timeout after 3 seconds and also when certain http codes are returned. However, it doesn't time out until after 100 seconds when the HttpClient times out. Here ...
Niels Brinch's user avatar
  • 3,762
2 votes
1 answer
4k views

Below is my code in C# Windows application, where connection with Oracle, FTP and Null Reference Exception are handled: public Result Execute() { Result result = null; string errorMessage = ...
Ch.'s user avatar
  • 111
1 vote
1 answer
2k views

I'm trying to find the best solution to reload Azure Secrets in a .NET 5 application. I will write here what I have now. First I did this: .ConfigureAppConfiguration((context, configuration) => { ...
Catalin's user avatar
  • 41
2 votes
0 answers
330 views

The end outcome is to shut down the application if a specific type of exception (DatabaseException) has occurred. However the current method HandleDatabaseException does not stop the application, the ...
DrExpresso's user avatar
4 votes
1 answer
2k views

I'm having many timeouts exceptions using Polly Bulkhead policy, this policy helps me to limit the number of concurrent calls that I'm sending to a specific hosts. However It seems that the HttpClient ...
ganchito55's user avatar
  • 3,617
2 votes
1 answer
5k views

I'm attempting to log something before retrying a web api call using Polly in a .net core web api. I know the web api is failing and returning a 503 response code however there's nothing in my console ...
Bhav's user avatar
  • 2,287
1 vote
1 answer
726 views

I need to set up the circuit break policy so that it would break the circuit only for some specific requests. I have a sort of a gateway A calling API B which in turn calls C or D. I'm setting up a ...
gator88's user avatar
  • 1,233

1
3 4
5
6 7
11