On Sun, 2018-07-15 at 16:36 +1000, Alex Osborne wrote: > If I receive a server push is it possible to determine which client > request it was sent in response to?
Hi Alex Not unless the server is willing to help with that. Why do not you add a correlation id of a sort to the promised request from AsyncPushProducer? Oleg > I'm not actually after the data of the request just some way to map > it back. Some opaque id, object, callback or whatever I can supply > with the request and later get back when a push comes in would do > just fine. > > I figured there might be a reference to original context in the push > request's context, but unfortunately AsyncPushConsumer doesn't > receive the HttpContext and even if I get at it by backtracking up > the stack in a debugger it seems to be a fresh context with no > reference to the original one. > > Does that mean the only way to associate a server push with the > original client request is to create a new HttpClient for each > request? (As then there'd be only be one request for each client.) > That wouldn't be so bad if they could share resources. I see a > promising looking setConnectionManagerShared() but I can't see a way > to get two HttpClients to use the same IOReactor and so would end up > with a lot more threads than I really want. > > Thanks, > > Alex > --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org