-
Notifications
You must be signed in to change notification settings - Fork 174
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 metadata extension for Route Advertising #262
Comments
+1 I'd love to be able to make the CLI tools complete routes for endpoints |
I guess, what is a discoverable OpenAPI for RSocket? |
https://github.com/rsocket-routing/rsocket-routing has such functionality, isn't it? |
@whyoleg do you have overlap to transfer this? |
it has not.
Technically, it can be a good idea to add a spec extension for OpenAPI or develop something identical to that. This is a demandable feature and I was asked about Swagger compatibility a couple of times. Does anybody want to start a PR? |
Although I don't think a connection setup phase is a good place for transferring that since we don't have any handshake mechanism which allows both sides to transfer routes via setup payload metadata. The only possible option is metadata push as a way to push information about available routes. E.g, if it is a swagger-like client connects to any server, it may do |
Seems wasteful to always send it. Perhaps a request at a known route. Also it's awkward to wait for it when you don't know for sure if it's coming. Maybe an implicit route on a requestResponse operation? Something like https://en.wikipedia.org/wiki/List_of_/.well-known/_services_offered_by_webservers .well-known/routes ->
|
I guess if we request routes via requestResponse, it may end up with an error or unpredicted response, e.g. in the case when an application framework does not support routing advertisement but suddenly receive unwanted requestResponse.
What if this is not an operation that should ever happen? Imagine a dynamic mechanic which may react to a received metadata_push that advertises remote party routes. Since this is metadata_push, the responder may ignore it which is fine. In case it is an expected request, the responder upon reception of that message may enable additional functionality. For example, in the case of CLI tool, before reception of the metadata-push message, CLI may have route autocompletion disabled, but once metadata_push happens, it may enable it so all the following interactions will have autocompletion. In the case of swagger-like UI, the browser client will be displaying zero routes, but once metadata_push will be received, the UI will react and render received info |
+1 worth speccing out. I was curious if there was some nice intermediate step to get a ["searchTweets", "timer", "tweet/{id}"] from a server I connect to. metadata push is terrible for this because you don't know when to stop waiting. |
|
Now, after some time working on rsocket, I have an idea, that something like this can be implemented via an extension for a protocol using EXT frame, which at current moment are not implemented anywhere and there is no info about examples in spec. EXT frame content provides us only type of extension, some payload and can it be ignored or not. For route advertising, possible prototype extension workflow:
The only issue is that if we want to be able to make it both:
We need to have some additional flag for EXT frame - now we have only (I)gnore flag, but looks like we will also want a flag, saying that if it's not supported, tell me about it, let's call it (A)cknowledgment flag. And we need counterpart frame (let's call it EXT_ACK) from responder to say, that extension is not supported, but don't close connection. So, if responder supports EXT, it will do the logic, but if it don't support, then we will have following cases when requester sends EXT frame:
|
Is it possible to provide |
With #254 we can now forward routing information alongside any rsocket request.
Mediation layers (gateway, sidecar, proxy...) and discoverable services might still need to register explicit routes interests on remote client connection setup.
Advertising routes could be done with the same routing metadata mime type attached on connection payload and possibly updated dynamically with more metadata pushes. We can consider the latter in a different issue.
The text was updated successfully, but these errors were encountered: