All Versions
Latest Version
Avg Release Cycle
Latest Release

Changelog History

  • v1.6.0 Changes


    • ➕ 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("") .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](
  • v1.5.0 Changes


    • 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)
      var client = Methanol.newBuilder()
      var request = MutableRequest.GET("");
      var response = (CacheAwareResponse<Path>) client.send(
          request, BodyHandlers.ofFile(Path.of("banana_cat.mp4")));
          "%s (CacheStatus: %s, elapsed: %s)%n",
          Duration.between(response.timeRequestSent(), response.timeResponseReceived()));
    • ➕ Added CacheControl to model the Cache-Control header and its directives. This is complementary to the new cache as all configuration is communicated through Cache-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 backing HttpClient. 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 of java.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


    • ⚡️ 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


    • Multipart progress tracking.
  • v1.3.0 Changes


    • 0️⃣ Default read timeout in Methanol client.
    • API for tracking upload/download progress.
    • High-level client interceptors.
  • v1.2.0 Changes


    • Reactive JSON adapters with Jackson and Reactor.
    • Common MediaType constants.
    • XML adapters with JAXB.
  • v1.1.0 Changes


    • 🚀 First "main-stream" release.
  • v1.0.0 Changes


    • 🚀 Dummy release.