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
Add support for Dapr to callback into App via a different endpoint #867
Comments
I don't understand.. what is the port here? And what's the actual proposal? Can you give a concrete example of what you mean? |
The main app can have APIs like /order/new, /customers/list, etc. These APIs are exposed to the frontend, for example. For callback functionality for Dapr, like in PubSub or Actors, for example, the App can choose to expose another endpoint. |
Ok, what you just said is the situation today. So what's the proposal? |
If this is possible today, then there is nothing to be changed. Let me close this. |
But you opened it because of an observation.. so I want to understand exactly what it is. Do you mean the app might have two apis on two different ports? |
The app might have two ports: each serving a different endpoint. |
Oh ok, so it is indeed supported. You can tell Dapr today which port the app is listening on. Ok to close? |
How is this done today when there's multiple? Is there an example configuration? |
If the app has 2 servers with different ports, you pass the port designated for Dapr via the --app-port flag. |
I understood this before closing it earlier. Good to make it clear, though. Maybe we can update this issue to make this obvious in the docs. |
The --app-port flag is used a lot in the docs. Do you think there's a place to show case this more? if so, lets open an issue on docs. The --app-port flag is mandatory if the app needs Dapr to call into it. |
I am not talking about the port flag, I am talking about making it clear that this is how Dapr should be integrated: creating a new endpoint for Dapr. In the examples, the apps only have one API, so it can lead to the conclusion that Dapr is coupled with the apps' api. It is clear to me now, but someone going through the documentation might take a while to understand this. |
In the majority of cases users will only use one API, that's also how we observed people using Dapr until now. We can add a How-To or sample of an app with two endpoints, each with a different port. |
How-To is a good idea. Once the API has authentication - which I would expect for a production scenario, it would stop working, not? Plus, by decoupling the APIs, the app can make use of grpc for Dapr while keeping this http API for the frontend. IMO, a Dapr specific endpoint should be the recommended solution for production scenarios. I guess we will learn more once customers start deploying Dapr in production. |
Decouple App API from Dapr callback API
Today Dapr is calling back into the same API endpoint that is used for the App's main functionality. There are different requirements, including security, for Dapr callback and the App's exposed API. Dapr should have a parameter to determine an optional callback api port that can be used instead of the app's main port.
The text was updated successfully, but these errors were encountered: