Changelog History
-
v1.6.0 Changes
30-5-2021
- โ Added
HttpCache.Listener
. - โ Added
TaggableRequest
. This facilitates carrying application-specific data throughout interceptors & listeners. ```java var interceptor = Interceptor.create(request -> { var taggableRequest = TaggableRequest.from(request); var myContext = taggableRequest.tag(MyContext.class).orElseGet(MyContext::empty); ... }); var client = Methanol.newBuilder() .interceptor(interceptor) .build();
var myContext = ... var request = MutableRequest.GET("https://example.com") .tag(MyContext.class, myContext); var response = client.send(request, BodyHandlers.ofString());
* ๐ Fixed disk cache possibly manipulating the disk index concurrently. This could happen if an index update is delayed, as the scheduler mistakenly ran the index write immediately after the delay evaluates instead of queuing it with the sequential index executor. * ๐ Fixed `TimeoutSubscriber` (used in `MoreBodySubscribers::withReadTimeout`) possibly calling downstream's `onNext` & `onError` concurrently. This could happen if timeout evaluates while downstream's `onNext` is still executing. * ๐ฆ Made `AsyncBodyDecoder` ignore upstream signals after decoding in `onNext` fails and the error is reported to `onError`. This prevents receiving further `onXXXX` by upstream if it doesn't immediately detect cancellation. * ๐ฒ Made the disk cache catch and log `StoreCorruptionException` thrown when opening an entry. This is done instead of rethrowing. * `Methanol` now always validates request's `URI` after being resolved with the optional base `URI`. Previously, the `URI` was only validated if there was a base `URI`. * โฌ๏ธ Upgraded [gson to 2.8.7](https://github.com/google/gson/blob/master/CHANGELOG.md#version-287).
- โ Added
-
v1.5.0 Changes
14-5-2021
Methanol now has an [RFC-compliant][httpcaching_rfc] HTTP cache! It can store entries on disk or in memory. Give it a try!
void cache() throws InterruptedException, IOException { var cache = HttpCache.newBuilder() .cacheOnDisk(Path.of("cache-dir"), 100 * 1024 * 1024) .build(); var client = Methanol.newBuilder() .cache(cache) .build(); var request = MutableRequest.GET("https://i.imgur.com/NYvl8Sy.mp4"); var response = (CacheAwareResponse<Path>) client.send( request, BodyHandlers.ofFile(Path.of("banana_cat.mp4"))); System.out.printf( "%s (CacheStatus: %s, elapsed: %s)%n", response, response.cacheStatus(), Duration.between(response.timeRequestSent(), response.timeResponseReceived())); cache.close(); }
โ Added
CacheControl
to model theCache-Control
header and its directives. This is complementary to the new cache as all configuration is communicated throughCache-Control
.๐ Interceptors have been reworked. The old naming convention is deprecated. An interceptor is now either a client or a backend interceptor instead of a pre/post decoration interceptor, where 'backend' refers to
Methanol
's backingHttpClient
. The cache intercepts requests after client but before backend interceptors. It was tempting to name the latter 'network interceptors', but that seemed rather confusing as not all 'network' requests can be intercepted (HttpClient
can make its own intermediate requests like redirects & retries).โ Added
HttpStatus
, which contains functions for checking response codes.โ Added
ForwardingEncoder
&ForwardingDecoder
. These are meant for easier installation of adapters from the classpath.๐ฒ
System.Logger
API is now used instead ofjava.util.logging
.๐ Fix: Don't attempt to decompress responses to HEADs. This fixed failures like
unexpected end of gzip stream
.๐ Fix: Decompressed responses now have their stale
Content-Encoding
&Content-Length
headers removed.๐ Changed reactor dependency to API scope in the
methanol-jackson-flux
adapter.๐ Upgraded Jackson to 2.12.3.
๐ Upgraded Reactor to 3.4.6.
๐ New project website!
-
v1.4.1 Changes
26-9-2020
- โก๏ธ Updated dependencies.
- ๐ Fix: Autodetect if a deflated stream is zlib-wrapped or not to not crash when some servers
incorrectly send raw deflated bytes for the
deflate
encoding.
-
v1.4.0 Changes
27-7-2020
- Multipart progress tracking.
-
v1.3.0 Changes
22-6-2020
- 0๏ธโฃ Default read timeout in
Methanol
client. - API for tracking upload/download progress.
- High-level client interceptors.
- 0๏ธโฃ Default read timeout in
-
v1.2.0 Changes
1-5-2020
- Reactive JSON adapters with Jackson and Reactor.
- Common
MediaType
constants. - XML adapters with JAXB.
-
v1.1.0 Changes
17-4-2020
- ๐ First "main-stream" release.
-
v1.0.0 Changes
25-3-2020
- ๐ Dummy release.