-
Notifications
You must be signed in to change notification settings - Fork 36
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
Contextual data for proxied request #71
Contextual data for proxied request #71
Comments
Might be related #50 |
Thanks for the heads-up @fbuetler |
I pushed an example implementation #96, using a wrapper (indeed I think HttpServerRequestWrapper is the most decent approach) so that context can bind to each request. Usage example: // Before
vertx.createHttpServer().requestHandler(proxy);
// After
vertx.createHttpServer().requestHandler(request -> {
ContextedHttpServerRequest contextedRequest = ContextedHttpServerRequest.from(request);
contextedRequest.set("key", "value");
proxy.handle(contextedRequest);
}); What do you think? @tsegismont |
Thanks for your proposal @wzy1935 I'm not sure we should pursue in this direction. We already have a mechanism for extended HTTP request in Vert.x Web. I don't think it's a good thing to do the same in Vert.x core (which doesn't have the need for this). |
I think the additional context data must be passed through the (I think I'm running out of ideas) |
This looks to be going in the right direction, in my opinion. We can still have And then, like in your prototype, the /**
* Handle the <i><b>outbound</b></i> {@code HttpServerRequest}.
*
* @param request the outbound {@code HttpServerRequest}
*/
void handle(HttpServerRequest request, Map<String, Object> attachments); We can use the existing concept of attachments to the Next step is to overoload (and maybe deprecate) the |
We should have the ability to provide some contextual data when handing over a request to the proxy.
This data should be accessible to all the different proxy components (e.g. origin selector, interceptors).
Possibly related to #35 and #44
The text was updated successfully, but these errors were encountered: