On Mon, 2013-06-03 at 00:10 +0300, Marko Asplund wrote: > Oleg wrote: > > > Marko wrote: > > > I noticed that one problem with this approach was that I'm not able to > > > intercept redirected requests. > > > HC seems to be using DefaultRequestDirector for executing the > > > redirected requests instead of the custom executor. > > > > > > Does using the new executions chain APIs solve this issue? > > > > It should. > > ok. I did some experimenting with this using HC 4.3b1, and it does > appear to work. > My proto code is available here: > > https://github.com/marko-asplund/tech-protos/blob/master/hc-proto/src/main/java/fi/markoa/proto/hc/RequestInterceptionDemo.java > > Is this the correct way to use the new API? >
I had something different in mind (see my pull request) but if that works then it is certainly not wrong. https://github.com/marko-asplund/tech-protos/pull/1 > Are any big changes expected in HC 4.3 beta before the final release? > Any estimates for HC 4.3 final release date? > No big changes are planned. I just need to rewrite the tutorial. You can expect 4.3b2 in a week or two and a GA by the end of summer. > As a side note, try-with-resources doesn't seem to work well with a > set of related resources some of which implement AutoCloseable and > some that don't. For example it doesn't seem to be practical to use > try-with-resources with CloseableHttpClient, CloseableHttpResponse and > HttpEntity, because if the first two would be closed automatically > while the last one would be closed in a finally block, the resources > would be closed in an incorrect order. > It is no longer necessary to consume response entities from a finally clause. CloseableHttpResponse#close() will take care of resource deallocation in case the response content has not been fully consumed. Hope this helps Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
