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.
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.
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.
Pull Requests (9)
-  - Read the request body on demand (ldaley)
-  - updated ratpack-test-groovy to ratpack-groovy-test (ari-becker)
-  - Adding HTTP OPTIONS method support (glaforge)
-  - Improve ContentCompressor (beckje01)
-  - Provide support for configuring a connection timeout for HttpClient. (brucenunk)
-  - Renderer docs (danthegoodman)
-  - Properly call onClose method when connection is closed abruptly by peer. (niwinz)
-  - upgrade netty to 4.1.0.Beta7. All test passed (bobwenx)
-  - 'Connection: Close' directive is not being respected (brucenunk)
Resolved Issues (25)
-  - Optimize path checking by caching path to regex comparison
-  - Provide prominent documentation of all built in renderers
-  - Support deferred reading of server request bodies
-  - No output is present when there is no logger binding
-  - Unable to reload Ratpack server from Groovy Console
-  - Upgrade to Netty 4.1b6
-  - Add Chain.notFound() for terminating processing within a scope
-  - Identity Accept-Encoding not always respected
-  - It's awkward to initialise the logging MDC map
-  - Add config source that parses values from command line args
-  - Expose application args to ratpack.groovy scripts
-  - Provide support for configuring a connection timeout for HttpClient.
-  - Jackson JSON parser should attempt to parse content where mime type ends in `+json`
-  - Exec interceptors don't wrap execution error handlers
-  - DefaultResponse#expireCookie does not set path
-  - Convert a promise for an iterable into a publishable
-  - Remote commands should run on a blocking thread so they can be synchronous
-  - WebSocketHandler onClose method is not called when connection is abruptly closed.
-  - Pac4j clients cannot be determined dynamically
-  - General error during conversion: Error grabbing Grapes -- [download failed: com.fasterxml.jackson.core#jackson-annotations;2.5.0!jackson-annotations.jar(bundle)]
-  - Add error handlers to promise for dealing with certain kinds of errors.
-  - Upgrade to Jackson 2.6.2
-  - Allow @NonBlocking to be applied to function method arguments to indicate that they are async
-  - 'Connection: Close' directive is not being respected
-  - Upgrade to Handlebars 2.3.0