-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-Dapr endpoints invocation supported? #1311
Comments
Using Dapr for service invocation against Dapr endpoints gives you service discoverability. If you don't need the discoverability and know the port of what you're trying to access, it gives you a mechanism to attempt invoking a REST endpoint using an HTTP-based invocation. In your example, you're going a step further and accessing a completely external API - might I ask why you're bothering with the DaprClient and not just using an HttpClient to invoke it like you would any other REST endpoint? |
@ZenwalkerD Can you be more specific about what didn't work? Did the call fail, and in what way? Could you provide a repro code/project that demonstrates the issue? |
Because of Daprs feature of resiliency. Dapr provides retries and other policies. So i was hoping to make use of all those features in invoking external network calls. Otherwise i have to rely on some libraries like Polly.net. |
Code is very simple. Plain ASP NET CORE WEB API project with a GET controller having above provided code. Assuming that all dependencies are added for Dapr and others. |
@ZenwalkerD You'll need to provide more context; for example, how was the application and Dapr sidecar started, what do the Dapr sidecar logs show (with |
Sorry for the delay in response. I am now running on local via Dapr CLI tool. I have below yaml config:
when i run command: dapr run -f . (dir where yaml exist) everything runs normal. I am able to access my app and execute the API. Btw i tried changing the API invocation code as shown:
With above code; no error logs were thrown by dapr. However; when i changed back to original code in my first post here; then i got this error:
|
Ask your question here
Dear All,
In the Dapr documentation i noticed that a service can invoke a Non-Dapr endpoints like https://reqres.in/api/users?page=2 (external APIs).
But when i checked the Dotnet Dapr documentation; i could not find any code related to that.
I tried below code and it does not work..
Please let me know if the support is planned or where can i find a documentation?
The text was updated successfully, but these errors were encountered: