Version 1.5.0
Released on 2017-09-04.
A little over 6 months in the making, Ratpack 1.5.0 is now available. This release adds many new features and capabilities, squashes copious bugs and refines and optimizes many internals. Ratpack 1.5.0 is bigger, badder and faster.
The following core dependencies have been upgraded:
- Jackson 2.7.5 → 2.8.7
- Netty 4.1.4.Final → 4.1.9.Final
- Guava 19.0 → 21.0
- Caffeine 2.3.1 → 2.4.0
- Slf4j 1.7.21 → 1.7.28
The new ratpack-jdbc-tx
module adds support for Promise
based JDBC transactions. It centers around the new ratpack.jdbctx.Transaction
type.
The new ratpack-consul
modules provides the ratpack.consul.RatpackConsulConfig
factory for creating configuration sources backed by Consul. This is a convenient way to centralize configuration for your app and separate it from deployment.
The new Promise.mapIf
and Promise.flatMapIf
methods allowing supplying an “else” to a promise transform.
The new Promise.retry
methods allowing retrying a failed promise with various strategies.
The new Promise.defer
methods make it more convenient to delay yielding a promise.
The new Promise.cacheResultFor
method (and friends) make it easier to have more sophisticated caching policies for async values.
The new Promise.close
method makes it easier to perform async cleanup/disposal.
Various new utilities have been added to the Streams
class such as fork()
, take()
, concat()
, batch()
and flatten()
. These utilities enable more patterns for working with async data streams.
The new ByteBufStreams
class provides utilities for dealing with streams of Netty ByteBuf
.
The new Execution.sleep()
methods provide a non blocking analog to Thread.sleep()
.
You can now specify an idle timeout for server connections. This affects active connections and inactive connections (i.e. keepalive). It can also be overridden on a per request basis, which is particularly useful when streaming a lot of data, or streaming eternally.
Ratpack's HTTP client now supports SSL connections leveraging SNI. No extra config is required.
The new ReadWriteAccess
utility is an analog of the JDK's ReadWriteLock
.
The new FileIo
utility provides non blocking filesystem read/write access.
It is now possible to use Netty's SSL support via ServerConfigBuilder.ssl. Netty's SSL implementation is far more efficient in environments where OpenSSL is available. All users currently using SSL with Ratpack should migrate to using this new method.
If the client connecting to the server identified itself, you can now obtain its certificate via Request.getClientCertificate
.
There are also many other new convenience methods, bug fixes and generally cool stuff added in this release. Thanks to all who contributed.
We hope you enjoy Ratpack 1.5.
--
Team Ratpack
Links
Pull Requests (35)
- [1033] - Add ability to control content negotiation when client doesn't provide Accept header (davidmc24)
- [1035] - ServerConfig.address is configurable (JonasHavers)
- [1036] - Docs Fix: change reference to deprecated module (aaronzirbes)
- [1041] - Adding method to install handlers and chains from registry, and chains by instantiation (drmaas)
- [1045] - Added Missing `@Override` (AndrewReitz)
- [1083] - Include URL query string in NCSA request log (mkavanagh)
- [1086] - Add Promise.nextOpIf(Predicate<? super T> predicate, Function<? super T,? extends Operation> function) (brucenunk)
- [1093] - Manual: Expand on HTTP Request parsing (danthegoodman)
- [1094] - Remove extranous @Nullable annotation (danthegoodman)
- [1095] - Manual: Reorganize handler introduction for better flow (danthegoodman)
- [1107] - Provide if/else constructs on Promise and Chain. (felipefzdz)
- [1117] - Surface error when request bodyStream is closed unexpectedly (danveloper)
- [1123] - Add `Promise.retry` (rhart)
- [1128] - Add `Streams.concat` (rhart)
- [1131] - CharSequence for Body Type (beckje01)
- [1138] - Remove <op>IfOrElse in favor of Function.applyIfOrElse. (johnrengelman)
- [1142] - Enable SSL SNI support in default http client (carhartl)
- [1151] - Fix issue with metrics truncating seconds from request time measurement (jeff-blaisdell)
- [1167] - Upgrade dependencies (jackson & snakeyaml) (niwinz)
- [1172] - Extends 'by method handler' builder with handler class/instance arguments (timic)
- [1174] - Point to non-deprecated method `Promise#async` instead of `Promise#of` (mkobit)
- [1184] - Use noneMatch instead of negating anyMatch (kamilszymanski)
- [1204] - fix shell scripts classpath (katoquro)
- [1206] - Change ConfigDataLoader to ignore null sourceNodes on merge (pschilli)
- [1213] - Use jar archive name as pattern in shell script fix. (katoquro)
- [1216] - Check for presence of error before debug log (jonmort)
- [1220] - Fixed NotInRegistryException (swiftrs)
- [1222] - Update Hikari to 2.6.2 (beckje01)
- [1225] - Upgrade to Handlebars.java v4.0.6 (rainboyan)
- [1228] - Update DefaultRequestFixture.java (ean5533)
- [1234] - Fix Download Links (beckje01)
- [1237] - Fix path binding in request fixture (tomdcc)
- [1239] - provide a default connect timeout for http client, closes #1230 (drmaas)
- [1240] - Use https repo url instead of http. (tylerbenson)
- [1251] - Bump hystrix version to 1.5.13 (rpalcolea)
Resolved Issues (50)
- [612] - Add support for read/write timeouts
- [773] - ByMethodSpec and ByContentSpec should have `Handler` accepting overloads of `Block` methods.
- [945] - Support for gracefully dealing with session deserialisation failures.
- [1008] - Add Promise.cacheFor(Function<ExecResult<T>, Duration> cacheFor) for conditionally caching with variable TTLs
- [1023] - Add ability to control content negotiation when client doesn't provide Accept header
- [1032] - ServerConfig.address should be configurable via environment variable and system property
- [1038] - Add support for transactional promises with JDBC
- [1076] - Proxied compressed EOF framed message never completes
- [1084] - Add Promise.nextOpIf(Predicate<? super T> predicate, Function<? super T,? extends Operation> function)
- [1089] - Provide if/else constructs on Promise and Chain
- [1091] - FileRenderer only works with GET requests
- [1112] - Request.getBodyStream is never completed if client drops connection
- [1113] - Flexibility for autoCloseable in Promise and Operation
- [1116] - HttpClient read timeouts are not propagated correctly from streamed responses.
- [1122] - Add Promise.retry
- [1125] - Add Streams.take
- [1126] - Add Streams.concat
- [1129] - Configurable SO_BACKLOG
- [1135] - Groovy GString values are ignored by props() in ServerConfigImposition
- [1144] - Support null result in MultiEntryRegistry#maybeGet
- [1145] - HTTPS client certificate access
- [1163] - Leak with streamedResponse.forwardTo(context.getResponse())
- [1166] - Upgrade to Jackson 2.8.x
- [1171] - Should implicitly drain request body if responding without reading it
- [1175] - Provide api to allow changing Ssl implementation
- [1176] - Executions may incorrectly terminate when immediately resumed from a different thread.
- [1177] - Add promise based version of ReadWriteLock
- [1178] - Provide utilities for working with files in a non blocking manner
- [1180] - Update to Netty 4.1.9
- [1182] - Config item bindings cannot be overridden in user modules
- [1183] - Reading a too large request body should raise a 413 response by default
- [1185] - RequestOutcome.getDuration throws NPE if never sent
- [1187] - HttpClient connections not released from the pool when channel goes inactive
- [1188] - Allow configuring the chunk size when streaming a response with the HTTP client
- [1189] - Content length header should not be sent on 1xx, 204 or 304 responses.
- [1190] - Upgrade to Handlebars.java 4.0.x
- [1191] - Upgrade to Thymeleaf 2.1.5
- [1194] - Support emitting comments with server sent events
- [1197] - Add renderer for Rocker templates
- [1198] - Upgrade to Guava 21
- [1199] - Upgrade to Caffeine 2.4.0
- [1200] - Service dependencies on legacy service types are ignored
- [1203] - Wrong CLASSPATH in shell scripts (trivial)
- [1205] - Empty yaml and json configuration files cause NullPointerException
- [1209] - Json config test contains a typo
- [1215] - Debug log states an error on post when there is no error
- [1219] - NotInRegistryException thrown in ratpack.pac4j.internal.RatpackWebContext
- [1230] - Provide configurable default connect timeout for http client
- [1253] - Warning is always logged at debug about error draining request body
- [1254] - HTTP client incorrectly follows 301 and 302 redirects with original verb