I would like to create an AsyncRestTemplate
which also has Http Caching enabled...
From what I've read, it seems as though I need to explicitly enable Http Caching by creating a AsyncHttpClient (How do I create an async caching http client? ).
Unfortunately, I can't find any RestTemplate
(or ClientHttpRequestFactory
) constructors that allow me to utilise the HttpAsyncClient interface (frustratingly the HttpComponentsAsyncClientHttpRequestFactory takes a CloseableHttpAsyncClient
abstract class??).
I'm currently contemplating writing a custom ClientHttpRequestFactory
as an input to the AsyncRestTemplate
- am I on the right path?
Related:
- docs.spring.io / AsyncRestTemplate
- docs.spring.io / HttpComponentsClientHttpRequestFactory
- docs.spring.io / HttpComponentsAsyncClientHttpRequestFactory
- hc.apache.org / HttpAsyncClient
- How do I create an async caching http client?