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