Version 1.1.0

Released on 2015-10-18.

The big feature of Ratpack 1.1 is the added support for deferring the read of request bodies. In 1.0 and prior, the request body was read eagerly and held in memory before control was passed to the application code. As of 1.1, this now happens on demand when the promise returned by Response.getBody() is subscribed to. There are also now variants of this method that allow the maximum size to be specified, along with actions to take should the body be too large. This change opens up many options for dealing with request bodies, such as throttling and dynamic maximum allowed sizes based on other request attributes (i.e. authorization). Ratpack 1.2 will add support for streaming the request body in, avoiding the need to hold it all in memory at once.

This release also has many other improvements and new features.

Support for dealing with OPTIONS requests with custom responses is now supported thanks to a contribution from Guillaume Laforge.

Hot reloading within the Groovy Console now works, making it a convenient place to prototype ideas for Ratpack apps written in Groovy.

The new MDCInterceptor.withInit() method makes it easier to initialize the MDC context for an execution.

It is now possible to specify a connection timeout when using the HttpClient thanks to a contribution from James Lee.

The built in JSON parsing (backed by Jackson) now will attempt to parse any content type that ends with +json, in addition to application/json. This is useful when dealing with vendor types that are actually JSON.

When using the Pac4j integration, it is now possible to determine the authentication clients to use based on the request details by using the new RatpackPac4j.authenticator() method that takes a function to determine the clients.

The new onError() promise methods make dealing with certain kinds of errors occurring.

It is now easy to use the application arguments as a source of config, via the new args(String[]) method on ServerConfigBuilder. Relatedly, when using a Groovy script as the application entry point (i.e. when using the ratpack-groovy Gradle plugin), the application args are now available as the args script variable.

There are also significant performance optimisations in this release, particularly around memory consumption.

We hope you enjoy Ratpack 1.1.0.


Team Ratpack.

Pull Requests (9)

Resolved Issues (25)