How to set the DaprClient invoke timeout
See original GitHub issueHow to set the DaprClient invoke timeout
I have an API that takes 2 minutes to complete, but the DaprClient invoke will time out after 100 seconds.
System.Threading.Tasks.TaskCanceledException: 'The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.'
at System.Net.Http.HttpClient.HandleFailure(Exception e, Boolean telemetryStarted, HttpResponseMessage response, CancellationTokenSource cts, CancellationToken cancellationToken, CancellationTokenSource pendingRequestsCts)
at System.Net.Http.HttpClient.<<SendAsync>g__Core|83_0>d.MoveNext()
at Dapr.Client.DaprClientGrpc.<InvokeMethodWithResponseAsync>d__24.MoveNext()
at Dapr.Client.DaprClientGrpc.<InvokeMethodAsync>d__26`1.MoveNext()
at Program.<<Main>$>d__0.MoveNext() in C:\Users\John\source\repos\DaprGround\Invoke.Client\Program.cs:line 17
Issue Analytics
- State:
- Created 8 months ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Getting started with the Dapr client .NET SDK
You can either use the DaprClient or System.Net.Http.HttpClient to invoke your services. SDK; HTTP. using var client = new DaprClientBuilder().
Read more >The Dapr service invocation building block
Invoke gRPC services using DaprClient. Invoke HTTP services using HttpClient. The preferred way to call an HTTP endpoint is to use Dapr's rich ......
Read more >Dapr Integration with Azure Container Apps - Part 4
The first thing to try out here is to run the Backend Web API using Dapr, from VS Code open a new PowerShell...
Read more >Dapr for .NET Developers - GitHub
Install Dapr into your local environment . ... Invoke gRPC services using DaprClient . ... A timeout is interpreted as a failure.
Read more >DaprClient (dapr-sdk-parent 1.9.0 API)
Invoke a service method, using serialization. <T> reactor.core.publisher.Mono<T>, invokeMethod(String appId, String methodName ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@johnseed - Thanks for bringing this up. We do need a way to expose this, which would probably be best done by exposing the actual factory/creation method. I’ll discuss it with some of the other active people in the repo.
In the meantime, since you’re using a direct http invoke, you can also do this with a raw
HttpClient
. Then you’d have full control over it, but you’d need to construct the endpoint yourself.I’m looking also into this to use the HttpClientFactory to inject middleware like for example an exception logger middleware
for example: A factory functions like this
And pass it to UseHttpClientFactory(Func<HttpClient> factory)