Lean & powerful HTTP apps

Related tags

ratpack
Overview

Build Status codecov.io Revved up by Gradle Enterprise

Ratpack.io

What is Ratpack?

Ratpack is a simple, capable, toolkit for creating high performance web applications.

Ratpack is built on Java and the Netty event-driven networking engine. The API is optimized for Groovy and Java 8.

Optional Google Guice integration provides a foundation for scaling your application in size in a managed way.

Optional Gradle build time support makes building and testing applications a breeze.

http://www.ratpack.io

Looking to contribute?

Please see CONTRIBUTING.md

Issues
  • Create website

    Create website

    Perhaps a simple Ratpack app for the site.

    opened by pledbrook 79
  • Publish binaries to Bintray.

    Publish binaries to Bintray.

    @robfletcher feel like tackling this?

    opened by ldaley 34
  • Deploy Ratpack application on Heroku

    Deploy Ratpack application on Heroku

    In order to deploy on Heroku, a buildpack is required to release your application.

    The official Gradle buildpack is stuck on Gradle 1.0-milestone-5 and jdk6. Besides that, it is very brittle and quite broken. I decided to set up a brand new buildpack that runs Gradle 1.5 with jdk1.7. You can find the preliminary version under heroku-buildpack-gradle-jdk7.

    I've managed to get the groovy-console example app up on Heroku, although it runs out of memory on invocation of gradle run. Seems like the quota is 512M on Heroku, so will look into tweaking the heap size on command invocation.

    Another problem that needs to be resolved: Heroku seeks to set the port dynamically on bootstrapping of the app. It expects the app to pick up environment variable PORT and dynamically configure itself to use it at runtime. Heroku then routes all requests to the application through the port that it provided earlier.

    I was looking at #5 and noticed some mentions of AddressConfig. We would probably need to inject the result of PORT into the port field of this object on startup of the app as part of the application lifecycle. Since this still seems to be under discussion at the moment, I will wait until it's better defined.

    opened by marc0der 33
  • Create preliminary user manual

    Create preliminary user manual

    (this issue is for creating the very first public version of the manua – it doesn't need to be comprehensive)

    Ratpack needs a basic user manual covering:

    1. Introduction
    2. Quick start
    3. Basic mechanics
    4. Scripts vs apps
    5. Sync vs async
    6. Extensions (modules)
    opened by pledbrook 30
  • Unable to do the gradle build due to jruby problem

    Unable to do the gradle build due to jruby problem

    I cloned the ratpack repo from ratpack/ratpack and am trying to do a gradle build using the supplied script. The result is:

    ./gradlew build ... lots of output ... :ratpack-manual:compileSass jruby: No such file or directory -- compass (LoadError) :ratpack-manual:compileSass FAILED

    FAILURE: Build failed with an exception.

    • What went wrong: Execution failed for task ':ratpack-manual:compileSass'.

      Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_11.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

    I'm running on OS X 10.8.4. Let me know if I should supply any more information.

    I tried installing jruby (through homebrew) and adding the sass and compass gems, but that didn't do anything. I'm not a Ruby person, so I don't know what else to do.

    opened by kousen 29
  • Support for HTTPClient interceptors.

    Support for HTTPClient interceptors.

    This change is Reviewable

    opened by johnrengelman 27
  • adjustments to filtering asset paths (#214)

    adjustments to filtering asset paths (#214)

    What do you think about these adjustments for filtering asset paths?

    Basically, I need the ability to do:

    getText "/swearengen/E.B./Al" == " .... "
    

    Right now, it's interpreting that as an asset because of the dots, when it's really dynamic content. I think this commit satisfies asset recognition.

    opened by danveloper 26
  • Support setting Ratpack's port through environment variables

    Support setting Ratpack's port through environment variables

    Ratpack can read the port variable with -Dratpack.port=80, but for easier integration with certain cloud environments (in my case, Cloud Foundry), it'd be easier for cloud deployments to be able to set the Ratpack port with an environment variable, for example:

    export RATPACK_PORT=80
    

    It might avoid creating a dedicated buildpack for Cloud Foundry, for instance.

    opened by glaforge 25
  • Pac4j documentation

    Pac4j documentation

    Hi,

    ratpack-pac4j is a module which handles authentication on various providers: it deserves a documentation. Where do you want me to put the chapter on this topic? As chapter 18 or 36? Thanks. Best regards, Jérôme

    opened by leleuj 23
  • Send a POST request with multipart/form-data using HttpClient

    Send a POST request with multipart/form-data using HttpClient

    Hello,

    I'm trying to send a POST request with UploadedFile from a Form data sent by the client, can I use HttpClient for this purpose?

    post('send') { HttpClient client ->
        def url = "${END_POINT}".toURI()
        client.request(url, { RequestSpec reqSpec ->
           reqSpec
                   .method('POST')
                   .body { RequestSpec.Body body ->
                       body.type('multipart/form-data')
                       ...
                   }
                   .headers { MutableHeaders headers ->
               headers.set('Content-type','multipart/form-data')
           }
       }).then { ReceivedResponse res ->
           res.forwardTo(response)
       }
    }
    

    I need to add some extra data of fields (like filename, language...), shall I use DefaultMultipartForm from test package?

    opened by bitsnaps 0
  • HikariConfig can not be deserialized by Jackson for Config

    HikariConfig can not be deserialized by Jackson for Config

    HikariConfig has been marked invalid subtype per https://github.com/FasterXML/jackson-databind/issues/2631 and can not be deserialized by Jackson for use during server configuration. I can submit a PR to work around it (perhaps a internal proxy of HikariConfig to be used by HikariModule) but is there a preference on approach?

    Exception below:

    java.lang.IllegalStateException: Failed to build required config items at ratpack.server.internal.DefaultServerConfigBuilder.extractRequiredConfig(DefaultServerConfigBuilder.java:414) at ratpack.server.internal.DefaultServerConfigBuilder.build(DefaultServerConfigBuilder.java:409) at ratpack.server.RatpackServerSpec.serverConfig(RatpackServerSpec.java:89) at ratpack.groovy.Groovy$Script.doApp(Groovy.java:341) at ratpack.groovy.Groovy$Script.lambda$appWithArgs$4(Groovy.java:333) at ratpack.server.internal.RatpackServerDefinition.build(RatpackServerDefinition.java:43) at ratpack.server.internal.DefaultRatpackServer.lambda$buildUserDefinition$4(DefaultRatpackServer.java:216) at ratpack.impose.Impositions.impose(Impositions.java:117) at ratpack.server.internal.DefaultRatpackServer.buildUserDefinition(DefaultRatpackServer.java:214) at ratpack.server.internal.DefaultRatpackServer.start(DefaultRatpackServer.java:117) at ratpack.server.RatpackServer.start(RatpackServer.java:93) at ratpack.groovy.GroovyRatpackMain.main(GroovyRatpackMain.java:38) Suppressed: java.lang.IllegalStateException: Could not bind config at '/hikari' to 'com.zaxxer.hikari.HikariConfig' at ratpack.server.internal.DefaultServerConfigBuilder.extractRequiredConfig(DefaultServerConfigBuilder.java:422) ... 11 more Caused by: java.io.UncheckedIOException: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Invalid type definition for typecom.zaxxer.hikari.HikariConfig: Illegal type (com.zaxxer.hikari.HikariConfig) to deserialize: prevented for security reasons at [Source: UNKNOWN; line: -1, column: -1] at ratpack.util.Exceptions.uncheck(Exceptions.java:52) at ratpack.config.internal.DefaultConfigData.getAsConfigObject(DefaultConfigData.java:62) at ratpack.server.internal.DefaultServerConfigBuilder.extractRequiredConfig(DefaultServerConfigBuilder.java:420) ... 11 more Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Invalid type definition for typecom.zaxxer.hikari.HikariConfig: Illegal type (com.zaxxer.hikari.HikariConfig) to deserialize: prevented for security reasons at [Source: UNKNOWN; line: -1, column: -1] at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:62) at com.fasterxml.jackson.databind.DeserializationContext.reportBadTypeDefinition(DeserializationContext.java:1570) at com.fasterxml.jackson.databind.jsontype.impl.SubTypeValidator.validateSubType(SubTypeValidator.java:195) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory._validateSubType(BeanDeserializerFactory.java:925) at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:141) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:414) at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264) at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244) at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142) at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:479) at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:4405) at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4184) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2545) at ratpack.config.internal.DefaultConfigData.getAsConfigObject(DefaultConfigData.java:59) ... 12 more

    opened by jwshin 4
  • Update to Guice 5.0.1

    Update to Guice 5.0.1

    See: https://github.com/google/guice/wiki/Guice501

    Changes since Guice 4.2.3

    • Some highlights:
    • Added Java15 support (updated asm and bug fixes).
    • Removed cglib as a core dependency. (#1359)
    • Improved error messages.
    • Improved support for using Guice with Kotlin.
    • Added a mechanism to restrict who can bind types or annotations, to allow library authors to control their bindings.
    • Removed no-aop build variant.
    • Fixed 'illegal reflective access' warnings.
    opened by paplorinc 0
  • NettyHandlerAdapter is noisy when portscraped over ssl

    NettyHandlerAdapter is noisy when portscraped over ssl

    When running Ratpack (1.8.2) using HTTPS on a public facing linux server, any non-ssl requests (such as port scrapes, or misconfigured clients) cause one of the following exceptions to be logged at ERROR level.

    r.s.i.NettyHandlerAdapter {}  io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL
    	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:471)
    	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
    	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
    	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
    	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    	at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory.lambda$newThread$0(DefaultExecController.java:137)
    	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    	at java.base/java.lang.Thread.run(Thread.java:834)
    Caused by: javax.net.ssl.SSLHandshakeException: error:100000f0:SSL routines:OPENSSL_internal:UNSUPPORTED_PROTOCOL
    	at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.sslReadErrorResult(ReferenceCountedOpenSslEngine.java:1288)
    	at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1249)
    	at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1325)
    	at io.netty.handler.ssl.ReferenceCountedOpenSslEngine.unwrap(ReferenceCountedOpenSslEngine.java:1368)
    	at io.netty.handler.ssl.SslHandler$SslEngineType$1.unwrap(SslHandler.java:206)
    	at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1387)
    	at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1282)
    	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1329)
    	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
    	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
    	... 16 more
    

    Or

    r.s.i.NettyHandlerAdapter {}  io.netty.handler.codec.DecoderException: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 474554202f636f6e6669672f676574757365723f696e6465783d3020485454502f312e310d0a486f73743a20332e32352e3232322e3132343a3434330d0a557365722d4167656e743a204d6f7a696c6c612f352e3020285831313b205562756e74753b204c696e7578207838365f36343b2072763a37362e3029204765636b6f2f32303130303130312046697265666f782f37362e300d0a4163636570743a20746578742f68746d6c2c6170706c69636174696f6e2f7868746d6c2b786d6c2c6170706c69636174696f6e2f786d6c3b713d302e392c696d6167652f776562702c2a2f2a3b713d302e380d0a4163636570742d4c616e67756167653a20656e2d47422c656e3b713d302e350d0a4163636570742d456e636f64696e673a20677a69702c206465666c6174650d0a436f6e6e656374696f6e3a20636c6f73650d0a557067726164652d496e7365637572652d52657175657374733a20310d0a0d0a
    	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:471)
    	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
    	at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:480)
    	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
    	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    	at ratpack.exec.internal.DefaultExecController$ExecControllerBindingThreadFactory.lambda$newThread$0(DefaultExecController.java:137)
    	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    	at java.base/java.lang.Thread.run(Thread.java:834)
    Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record: 474554202f636f6e6669672f676574757365723f696e6465783d3020485454502f312e310d0a486f73743a20332e32352e3232322e3132343a3434330d0a557365722d4167656e743a204d6f7a696c6c612f352e3020285831313b205562756e74753b204c696e7578207838365f36343b2072763a37362e3029204765636b6f2f32303130303130312046697265666f782f37362e300d0a4163636570743a20746578742f68746d6c2c6170706c69636174696f6e2f7868746d6c2b786d6c2c6170706c69636174696f6e2f786d6c3b713d302e392c696d6167652f776562702c2a2f2a3b713d302e380d0a4163636570742d4c616e67756167653a20656e2d47422c656e3b713d302e350d0a4163636570742d456e636f64696e673a20677a69702c206465666c6174650d0a436f6e6e656374696f6e3a20636c6f73650d0a557067726164652d496e7365637572652d52657175657374733a20310d0a0d0a
    	at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1261)
    	at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1329)
    	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
    	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:440)
    	... 16 more
    

    It would be nice to be able to customize Ratpack to suppress the stack trace, and modify this to be an INFO level message instead of an ERROR. Obviously suppression is preferable to hiding this message, as sometimes it is useful for diagnosing when actual customers have a misconfiguration. But the bots make it too noisy at present, and the level makes it trigger events in out log watching machinery

    Cheers,

    Tim

    opened by timyates 0
  • Supporting JDK 15

    Supporting JDK 15

    For my Ratpack application I would like to use JDK 15, but there is a dependency on Guice 4.1.0

    • https://ratpack.io/manual/current/guice.html#google_guice_integration

    but Guice only begins to support JDK 15 in 5.0.0-BETA-1

    • https://github.com/google/guice/wiki/Guice500

    While it may be possible to "force" a newer version on the classpath I suspect this would not work properly.

    I realize that dependency updates are currently planned for 2.0.0

    • https://ratpack.io/versions/2.0.0
    • https://github.com/ratpack/ratpack/pull/1558

    Wondering if anyone has considered pulling the dependency updates into 1.8.1?

    • https://ratpack.io/versions/1.8.1

    I will note that achieving JDK 15 compatibility is distinct from deprecating older versions, as in https://github.com/ratpack/ratpack/issues/1387

    For reference there may transitive dependency issues with other components (these versions should support JDK 15)

    • groovy 3.0.7 http://groovy-lang.org/releasenotes/groovy-3.0.html
    • gradle 6.7.1 https://docs.gradle.org/6.7.1/release-notes.html
    • lombok 1.18.16 https://github.com/rzwitserloot/lombok/releases
    • gradle-lombok v4.0.0 https://github.com/franzbecker/gradle-lombok/releases
    • spock 2.0-M4-groovy-3.0 (requires groovy 3) http://spockframework.org/spock/docs/2.0-M4/release_notes.html
    • guava 30.1-jre https://github.com/google/guava/releases

    Thoughts?

    opened by tmarble 1
  • MapPublisher should allow disposing of untransmittable items

    MapPublisher should allow disposing of untransmittable items

    As this publisher can enter into the complete state of its own accord (e.g. error in the mapping function), it should have provision for disposing any items that it cannot transmit.

    bug 
    opened by ldaley 0
  • Report custom server name on startup / shutdown

    Report custom server name on startup / shutdown

    A typical set of logging in a ratpack app looks something like this:

    2020-08-21 16:33:00,287 INFO r.s.RatpackServer {} Starting server... 
    2020-08-21 16:33:00,601 INFO r.s.RatpackServer {} Building registry... 
    2020-08-21 16:33:01,985 INFO r.s.RatpackServer {} Initializing 23 services... 
    (etc)
    2020-08-21 16:33:02,705 INFO r.s.RatpackServer {} Ratpack started for http://localhost:1234
    ...
    2020-08-22 17:24:10,526 INFO r.s.RatpackServer {} Stopping server... 
    2020-08-22 17:24:10,527 INFO r.s.RatpackServer {} Stopping 23 services... 
    (etc)
    2020-08-22 17:28:51,381 INFO r.s.RatpackServer {} Server stopped. 
    

    When examining log files, it can be useful to know which version of your server was running. This includes logs where the app startup may have been rotated out of existence.

    E.g. the actual log that you may have to deal with may look more like:

    ...
    2020-08-22 17:24:10,526 INFO r.s.RatpackServer {} Stopping server... 
    2020-08-22 17:24:10,527 INFO r.s.RatpackServer {} Stopping 23 services... 
    (etc)
    2020-08-22 17:28:51,381 INFO r.s.RatpackServer {} Server stopped. 
    2020-08-23 16:33:00,287 INFO r.s.RatpackServer {} Starting server... 
    2020-08-23 16:33:00,601 INFO r.s.RatpackServer {} Building registry... 
    2020-08-23 16:33:01,985 INFO r.s.RatpackServer {} Initializing 23 services... 
    (etc)
    2020-08-23 16:33:02,705 INFO r.s.RatpackServer {} Ratpack started for http://localhost:1234
    

    Which version of the app was running before / after the restart? It's easy enough to log out a version at app startup, but logging at shutdown would require a shutdown hook, and then where it actually gets logged may be dependent on relative order vs the Ratpack shutdown hook etc.

    If instead we allowed some sort of name to be registered when creating a RatpackServer, we could log this out at various points instead of the generic name and this would be useful even if the app crashes during startup / shutdown:

    RatpackServer.of(s -> s.serverConfig(config).registry(r).named("Foo 1.2.3").start();
    

    And the resulting logs would look like:

    ...
    2020-08-22 17:24:10,526 INFO r.s.RatpackServer {} Stopping Foo 1.2.3... 
    2020-08-22 17:24:10,527 INFO r.s.RatpackServer {} Stopping 23 services... 
    (etc)
    2020-08-22 17:28:51,381 INFO r.s.RatpackServer {} Foo 1.2.3 stopped. 
    2020-08-23 16:33:00,287 INFO r.s.RatpackServer {} Starting Foo 1.2.4... 
    2020-08-23 16:33:00,601 INFO r.s.RatpackServer {} Building registry... 
    2020-08-23 16:33:01,985 INFO r.s.RatpackServer {} Initializing 23 services... 
    (etc)
    2020-08-23 16:33:02,705 INFO r.s.RatpackServer {} Foo 1.2.4 started for http://localhost:1234
    

    Benefits over application-based logging using either before + shutdown hook or Ratpack based services:

    • Single set of banners instead of duplicated with Ratpack's built-in ones
    • Ratpack can ensure everything is logged at the correct time, get useful error messages even if something bad happens during startup / shutdown.
    • User doesn't need to worry about service dependencies or shutdown hook orders etc.
    opened by tomdcc 0
  • IllegalReferenceCountException with HttpClient in test

    IllegalReferenceCountException with HttpClient in test

    Hi John

    I found bug with HttpClient in test.

    The bug can be reproduced at https://github.com/eratolekov/ratpack-wiremock.

    I'm using wiremock to mock external http service. And ratpack's httpclient throws IllegalReferenceCountException during interaction with wiremocked service. However groovy httpclient for same test returns expected response.

    The bug is reproduced on 1.8.0, 1.7.4 versions.

    Steps to reproduce:

    1. Run test (./gradlew test)

    Expected behaviour: successful tests

    Actual behaviour:

    failed test 'ratpack httpclient'
    
    Condition failed with Exception:
    
    response.body.bytes.size() ==  1000
    |        |    |
    |        |    io.netty.util.IllegalReferenceCountException: refCnt: 0
    |        [email protected]
    [email protected]
    
    	at WireMockExampleSpec.ratpack httpclient(WireMockExampleSpec.groovy:51)
    Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
    	at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1489)
    	at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1418)
    	at io.netty.buffer.AbstractByteBuf.checkDstIndex(AbstractByteBuf.java:1444)
    	at io.netty.buffer.CompositeByteBuf.getBytes(CompositeByteBuf.java:1025)
    	at io.netty.buffer.CompositeByteBuf.getBytes(CompositeByteBuf.java:1987)
    	at io.netty.buffer.CompositeByteBuf.getBytes(CompositeByteBuf.java:49)
    	at ratpack.bytebuf.ByteBufRef.getBytes(ByteBufRef.java:405)
    	at io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:899)
    	at io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:873)
    	at io.netty.buffer.ByteBufUtil.getBytes(ByteBufUtil.java:865)
    	at ratpack.http.internal.ByteBufBackedTypedData.getBytes(ByteBufBackedTypedData.java:67)
    	... 1 more
    

    ps Thanks a lot for your great framework.

    opened by eratolekov 0
  • Environment variable config source does not support collections

    Environment variable config source does not support collections

    We can use that same syntax as Spring Boot: https://github.com/spring-projects/spring-boot/wiki/Relaxed-Binding-2.0#lists-1

    opened by ldaley 0
  • Ratpack reverse-proxy failed on 100-continue response

    Ratpack reverse-proxy failed on 100-continue response

    Hi

    I found bug of reverse-proxy of ratpack with "HTTP/1.1 100 Continue" response of upstream server.

    The bug can be reproduced at https://github.com/eratolekov/ratpack-100-expected. The "upstream-server" project - tiny http server that returns "HTTP/1.1 100 Continue" The "reverse-proxy" project - reverse-proxy based on Ratpack 1.8.0.

    Steps to reproduce:

    1. Run project from upstream-server dir (./gradlew run)
    2. Run project from reverse-proxy dir (./gradlew run)
    3. Execute curl -v -H "Expect: 100-continue" http://localhost:9000

    The bug is reproduced on 1.7.x version also.

    Expected behaviour:

    $ curl -v --noproxy localhost -H "Expect: 100-continue" http://localhost:8000
    * Expire in 0 ms for 6 (transfer 0x4d2cd0)
    * Expire in 1 ms for 1 (transfer 0x4d2cd0)
    * Expire in 0 ms for 1 (transfer 0x4d2cd0)
    * Expire in 2 ms for 1 (transfer 0x4d2cd0)
    * Expire in 1 ms for 1 (transfer 0x4d2cd0)
    * Expire in 1 ms for 1 (transfer 0x4d2cd0)
    * Expire in 1 ms for 1 (transfer 0x4d2cd0)
    *   Trying 127.0.0.1...
    * TCP_NODELAY set
    * Expire in 149997 ms for 3 (transfer 0x4d2cd0)
    * Expire in 200 ms for 4 (transfer 0x4d2cd0)
    * Connected to localhost (127.0.0.1) port 8000 (#0)
    > GET / HTTP/1.1
    > Host: localhost:8000
    > User-Agent: curl/7.64.0
    > Accept: */*
    > Expect: 100-continue
    >
    < HTTP/1.1 100 Continue
    < Content-Length: 0
    < HTTP/1.1 200 OK
    < Connection: keep-alive
    < Content-Type: text/plain
    < Content-Length: 11
    < Date: Mon, 22 Jun 2020 09:05:18 GMT
    <
    Hello World* Connection #0 to host localhost left intact
    

    Actual behaviour:

    $ curl -v --noproxy localhost -H "Expect: 100-continue" http://localhost:9000
    * Expire in 0 ms for 6 (transfer 0x6a2cd0)
    * Expire in 1 ms for 1 (transfer 0x6a2cd0)
    * Expire in 0 ms for 1 (transfer 0x6a2cd0)
    * Expire in 2 ms for 1 (transfer 0x6a2cd0)
    * Expire in 1 ms for 1 (transfer 0x6a2cd0)
    * Expire in 1 ms for 1 (transfer 0x6a2cd0)
    * Expire in 2 ms for 1 (transfer 0x6a2cd0)
    *   Trying 127.0.0.1...
    * TCP_NODELAY set
    * Expire in 149996 ms for 3 (transfer 0x6a2cd0)
    * Expire in 200 ms for 4 (transfer 0x6a2cd0)
    * Connected to localhost (127.0.0.1) port 9000 (#0)
    > GET / HTTP/1.1
    > Host: localhost:9000
    > User-Agent: curl/7.64.0
    > Accept: */*
    > Expect: 100-continue
    >
    < HTTP/1.1 100 Continue
    * Recv failure: Connection was reset
    * Closing connection 0
    curl: (56) Recv failure: Connection was reset
    
    opened by eratolekov 5
Releases(v1.8.2)
  • v1.8.2(Feb 11, 2021)

  • v1.8.1(Jan 19, 2021)

  • v1.8.0(Apr 27, 2020)

    Ratpack 1.8.0 is now available!

    This release adds support for configuring a proxy to utilize with the HttpClient for outgoing requests, additional convenience methods for Promise.retry, a number of dependency updates, and other improvements .

    The following core dependencies have been upgraded:

    • Netty 4.1.37.Final → 4.1.48.Final
    • Netty TCNative 2.0.25.Final → 2.0.30.Final
    • Jackson 2.9.8 → 2.10.3
    • Slf4j 1.7.25 → 1.7.30
    • Guava 21.0 → 28.2-jre
    • Dropwizard Metrics 4.0.5 → 4.1.6
    • Log4j 2.6.2 → 2.13.1
    • Caffeine 2.6.2 → 2.8.1
    • Retrofit 2.4.0 → 2.8.1

    Ratpack's HttpClient can now be configured to utilize a proxy server when sending requests using the HttpClientSpec. proxy method. Configuring the proxy requires specifying the host and port of the proxy. Optionally, the configured proxy can be bypassed for a set of destinations. This set uses the same pattern matching utilized by the core Java libraries and specified here: https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html. It should be noted that the HttpClient does not respect the http.proxyHost, http.proxyPort, and http.nonProxyHosts system properties.

    In this release, Promise.retry has been extended to allow for specifying a Predicate to indicate when the RetryPolicy should be evaluated.

    There are also a few other new convenience methods added to support easier development and testing of Ratpack applications. Thanks to all who contributed.

    We hope you enjoy Ratpack 1.8.

    --

    Team Ratpack

    Source code(tar.gz)
    Source code(zip)
  • v1.7.6(Jan 25, 2020)

    This release includes a fix for a security vulnerability. This upgrade is recommended for all Ratpack users.

    Versions of Ratpack 0.9.10 through and including 1.7.5 are vulnerable to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (aka. XSS), in the development error handler. An attacker can utilize this to perform XSS when an exception message contains untrusted data.

    This vulnerability only exists in the handler that renders an internal server error as a readable HTML page which is activates when Ratpack is running in development mode. This mode is only activate by user request (i.e. setting development(true) in the ServerConfig, setting RATPACK_DEVELOPMENT=true in the environment), or when Ratpack detects it is running in an IDE (i.e. IntelliJ), being run by the Groovy shell, or attached to a debugger. By default, Ratpack sets development(false) when packaged as a Jar.

    Users should verify that they are not running Ratpack with development mode activated in production environments.

    We would like to thank Jonathan Leitschuh for reporting this vulnerability.

    Please see the security advisory for this issue for more information.

    Source code(tar.gz)
    Source code(zip)
  • v1.7.5(Oct 17, 2019)

    This release includes several minor bug fixes, and a fix for a security vulnerability. This upgrade is recommended for everyone using 1.7.x.

    Versions of Ratpack 0.9.1 through and including 1.7.4 are vulnerable to HTTP Response Splitting, if untrusted and unsanitized data is used to populate the headers of a HTTP response. An attacker can utilize this vulnerability to have the server issue any HTTP response they specify.

    If your application uses arbitrary user input as the value of a response header it is vulnerable. If your application does not use arbitrary values as response header values, it is not vulnerable.

    Previously, Ratpack did not validate response header values. Now, adding a header value that contains the header value termination characters produces a runtime exception. As there is no mechanism for escaping or encoding the termination characters in a value, a runtime exception is necessary.

    As potentially dangerous values now cause runtime exceptions, it is a good idea to continue to validate and sanitize any user supplied values being used as response headers.

    We would like to thank Jonathan Leitschuh for reporting this vulnerability.

    Please see the security advisory for this issue for more information.

    Source code(tar.gz)
    Source code(zip)
  • v1.7.4(Oct 17, 2019)

    This release includes a fix for using Gradle's continuous build functionality when running on Java 9 or later. This upgrade is recommended for everyone using 1.7.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.7.3(Aug 18, 2019)

    This release includes a fix for HttpClient idle timeout that was introduced in Ratpack 1.7.0. Specifically, this timeout was incorrectly applying to in-use HTTP connections from the pool that were idle waiting for a server response. This fixes this behavior and clarifies that idleTimeout applies only to connections that are not currently acquired from the pool. This upgrade is recommended for everyone using 1.7.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.7.2(Aug 3, 2019)

    This release includes a fix for a regression introduced in 1.7.0 that resulted in double URL encoded query parameters in redirect responses. Please see the issue list below for details. This upgrade is recommended for everyone using 1.7.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.7.1(Jul 20, 2019)

    Ratpack 1.7.1 is now available! This patch release fixes a bug with idle connection timeouts for Ratpack's HttpClient (introduced in 1.7.0) which prevented timeouts larger than 1 second to be specified. No other changes were introduced.

    --

    Team Ratpack

    Source code(tar.gz)
    Source code(zip)
  • v1.7.0(Jul 14, 2019)

    Ratpack 1.7.0 is now available! This release adds support of idle timeouts when using connection pooling in HttpClient, an improved Promise.retry interface, a few dependency updates, deprecation of the ratpack-pac4j, ratpack-rx, and ratpack-thymeleaf modules and other improvements and bug fixes.

    The following core dependencies have been upgraded:

    • Netty 4.1.32.Final → 4.1.37.Final
    • Gradle 4.10 → 5.1.1
    • Groovy 2.4.15 → 2.5.4
    • Dropwizard Metrics 3.1.1 → 4.0.5
    • Spock 1.1-groovy-2.4 → 1.3-groovy-2.5
    • Handlebars 4.0.7 → 4.1.2

    The idle timeout for Ratpack's HttpClient can now be configured using the HttpClientSpec.idleTimeout method. Specifying a non-zero value for this timeout will allow Ratpack to close unused connections.

    The new Promise.retry method provides a mechanism for encoding complex retry logic in Promise behavior. With the addition of this method, the previous retry methods have been deprecated.

    Ratpack will now use the native OpenSSL libraries if available on the runtime system.

    The new MockApi and HandlerFactory classes provided additional fixtures for writing tests for Ratpack applications. Combined with a mocking framework such as Spock, they allow for declaring remote API behaviors for an application, inline to a test.

    As of this release the ratpack-pac4j library that is released as part of this project is officially deprecated and will be removed in Ratpack 2.0. Support for the latest version of Pac4j are provided via the ratpack-pac4j module maintained by the Pac4j team.

    As of this release the ratpack-rx and ratpack-thymeleaf libraries that are released as part of this project are officially deprecated and will be removed in Ratpack 2.0. Users should migrate to the ratpack-rx2 and ratpack-thymeleaf3 libraries.

    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.7.

    --

    Team Ratpack

    Source code(tar.gz)
    Source code(zip)
  • v1.6.1(Apr 24, 2019)

    This release fixes a security vulnerability around session ID generation and is recommended for all users.

    The issue stems from the default session ID generator using a cryptographically weak pseudo random number generator in the JDK's ThreadLocalRandom. This means that if an attacker can determine a small window for the server start time and obtain a session ID value, they can theoretically determine the sequence of session IDs. 1.6.1 uses system entropy when generating values to make the values non determinable.

    If you are using client side sessions, your application is not vulnerable as the session ID is not used.

    If you are using a version earlier than 1.6, you can fix the the issue by binding a custom SessionIdGenerator implementation based on the new version.

    Special thanks to Jonathan Leitschuh for discovering and reporting this vulnerability.

    Source code(tar.gz)
    Source code(zip)
  • v1.6.0(Dec 20, 2018)

    Just in time to ring in 2019, Ratpack 1.6.0 is now available! This release adds integration with additional reactive programming libraries and many improvements that allow Ratpack to integrate more seamlessly with external libraries.

    The following core dependencies have been upgraded:

    • Netty 4.1.22.Final → 4.1.32.Final
    • Jackson 2.9.4 → 2.9.8
    • ReactiveStreams 1.0.0.final → 1.0.2
    • Caffeine 2.4.0 → 2.6.2
    • SnakeYAML 1.18 → 1.23
    • Handlebars 4.0.6 → 4.0.7

    The new ratpack-reactor module adds support for integrating Ratpack with Project Reactor types.

    The new ratpack-rx2 module adds support for integrating Ratpack with version 2 of RxJava. This is a new module to support the new types introduced in RxJava 2.0.

    The new ratpack-thymeleaf3 module adds support for integrating Ratpack with version 3 of Thymeleaf templating.

    The new ratpack-gson module adds support for parsing request bodies and rendering responses using Google's Gson library.

    The new Promise.flatOp method allows for mapping a Promise directly into an `Operation.

    The new Promise.mapError and Promise.flatMapError which allow for providing a conditional Predicate for the mapping.

    The ability to configure request and response interceptors for Ratpack's HttpClient through the HttpClientSpec.requestIntercept, HttpClientSpec.responseIntercept(Action), HttpClientSpec.responseIntercept(Operation), and HttpClientSpec.errorIntercept methods.

    Create a new HttpClient instance by by inheriting from another instance using the HttpClient.copyWith method.

    Improvements in Ratpack's integration with Retrofit by allowing the underlying HttpClient to be specified with the RatpackRetrofit.Builder.httpClient method. This allows for utilizing Retrofit outside of a Ratpack HTTP request (e.g. from a background service)

    Forked executions can now obtain references to their parent executions through the Execution.getParent() and [Execution.maybeParent()] (https://ratpack.io/manual/1.6.0/api/ratpack/exec/Execution.html#maybeParent--) methods.

    Applications can now register their own JVM shutdown hook to perform custom behaviors instead of Ratpack's default hook. Applications using a custom hook can disabled the default hook by setting ServerConfigBuilder.registerShutdownHook(false)

    The ratpack-dropwizard-metrics module now supports exporting metrics to Prometheus (DropwizardMetricsConfig.prometheusCollection(true)) and collecting metrics on ByteBuf (DropwizardMetricsConfig.byteBufAllocator(Action)) and HttpClient (DropwizardMetricsConfig.httpClient(Action))

    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.6.

    --

    Team Ratpack

    Source code(tar.gz)
    Source code(zip)
  • v1.6.0-rc-4(Dec 20, 2018)

  • v1.6.0-rc-3(Dec 19, 2018)

    These are the release notes for a Ratpack 1.6.0 release candidate. Please see the pending release notes for the final release for the complete list of closed issues.

    This third release candidate of Ratpack 1.6 fixes:

    • #1424, optimize transmitting files
    • #1423, Response finalizers cannot be added when streaming or sending files
    • Removes the deprecation from TypedData.getBytes() and fixes the implementation to return only valid bytes from the buffer. Removes the previously added TypedData.copyBytes() method, removes the deprecation from `TypedData.
    • Handle closed connections when streaming responses.
    • Adds support for KQueue transport in Netty
    • Update to Netty 4.1.32.FINAL
    • Update to Jackson 2.9.8
    • Update to Snakeyaml 1.23
    Source code(tar.gz)
    Source code(zip)
  • v1.6.0-rc-2(Dec 1, 2018)

  • 1.6.0-rc-1(Nov 17, 2018)

    These are the release notes for a Ratpack 1.6.0 release candidate. Please see the pending release notes for the final release for the complete list of closed issues.

    A little over a year from our last minor release, and 6 months since our last patch, Ratpack 1.6.0 is now available. This release adds integration with additional reactive programming libraries and many improvements that allow Ratpack to integrate more seamlessly with external libraries.

    The following core dependencies have been upgraded:

    • Netty 4.1.22.Final → 4.1.31.Final
    • Jackson 2.9.4 → 2.9.5
    • ReactiveStreams 1.0.0.final → 1.0.2
    • Caffeine 2.4.0 → 2.6.2
    • SnakeYAML 1.18 → 1.20

    The new ratpack-reactor module adds support for integrating Ratpack with Project Reactor types.

    The new ratpack-rx2 module adds support for integrating Ratpack with version 2 of RxJava. This is a new module to support the new types introduced in RxJava 2.0.

    The new ratpack-thymeleaf3 module adds support for integrating Ratpack with version 3 of Thymeleaf templating.

    The new ratpack-gson module adds support for parsing request bodies and rendering responses using Google's Gson library.

    The new Promise.flatOp method allows for mapping a Promise directly into an `Operation.

    The new Promise.mapError and Promise.flatMapError which allow for providing a conditional Predicate for the mapping.

    The ability to configure request and response interceptors for Ratpack's HttpClient through the HttpClientSpec.requestIntercept, HttpClientSpec.responseIntercept(Action), HttpClientSpec.responseIntercept(Operation), and HttpClientSpec.errorIntercept methods.

    Create a new HttpClient instance by by inheriting from another instance using the HttpClient.copyWith method.

    Improvements in Ratpack's integration with Retrofit by allowing the underlying HttpClient to be specified with the RatpackRetrofit.Builder.httpClient method. This allows for utilizing Retrofit outside of a Ratpack HTTP request (e.g. from a background service)

    Forked executions can now obtain references to their parent executions through the Execution.getParent() and [Execution.maybeParent()] (https://ratpack.io/manual/1.6.0/api/ratpack/exec/Execution.html#maybeParent--) methods.

    Applications can now register their own JVM shutdown hook to perform custom behaviors instead of Ratpack's default hook. Applications using a custom hook can disabled the default hook by setting ServerConfigBuilder.registerShutdownHook(false)

    The ratpack-dropwizard-metrics module now supports exporting metrics to Prometheus (DropwizardMetricsConfig.prometheusCollection(true)) and collecting metrics on ByteBuf (DropwizardMetricsConfig.byteBufAllocator(Action)) and HttpClient (DropwizardMetricsConfig.httpClient(Action))

    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.6.

    --

    Team Ratpack

    Source code(tar.gz)
    Source code(zip)
  • v1.5.4(Sep 16, 2018)

    This release includes some minor bug fixes and performance improvements. Please see the issue list below for details. This upgrade is recommended for everyone using 1.5.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.3(Sep 16, 2018)

    This release includes some minor bug fixes and performance improvements. Please see the issue list below for details. This upgrade is recommended for everyone using 1.5.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.2(Sep 16, 2018)

    This release includes some minor bug fixes and performance improvements.

    Please see the issue list below for details. This upgrade is recommended for everyone using 1.5.0.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.1(Sep 16, 2018)

    This release squashes a few bugs, updates some key libraries and most importantly brings compatibility with Gradle 4.2 and higher.

    Please see the issue list below for details. This upgrade is recommended for everyone using 1.5.0.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0(Sep 16, 2018)

    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

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0-rc-3(Sep 16, 2018)

    These are the release notes for a Ratpack 1.5.0 release candidate. Please see the pending release notes for the final release for the complete list of closed issues.

    After an unfortunately long hiatus, we are back with 1.5.0-rc-3.

    This RC fixes the following issues raised with 1.5.0-rc-2:

    • [1254] - HTTP client incorrectly follows 301 and 302 redirects with original verb
    • [1253] - Warning is always logged at debug about error draining request body
    • [1219] - NotInRegistryException thrown in ratpack.pac4j.internal.RatpackWebContext
    • [1230] - Provide configurable default connect timeout for http client
    • [1190] - Upgrade to Handlebars.java 4.0.x

    Please try it out with your apps. The target date for 1.5.0 final is now Mon 28th of August.

    Source code(tar.gz)
    Source code(zip)
  • v1.5.0-rc-2(Sep 16, 2018)

  • v1.5.0-rc-1(Sep 16, 2018)

    These are the release notes for a Ratpack 1.5.0 release candidate. Please see the pending release notes for the final release for the complete list of closed issues.

    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

    Source code(tar.gz)
    Source code(zip)
  • v1.4.6(Sep 16, 2018)

    This patch release fixes a serious issue where Ratpack's HTTP client would not validate connections to HTTPS servers correctly (#1181). The certificate's domain name was not validated against the used connection address, meaning that any connection would be trusted as long as it had a trusted certificate.

    This fix will not be backported to Ratpack 1.3.x or earlier. It is strongly recommended that all Ratpack users upgrade to 1.4.6.

    Please see the release notes for 1.4.0 for changes since 1.3.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.4.5(Sep 16, 2018)

  • v1.4.4(Sep 16, 2018)

  • v1.4.3(Sep 16, 2018)

    This patch release fixes issues with direct memory leaks in several error conditions, and an issue with incorrect decryption of client side session values.

    It is strongly recommended that all 1.4.x users upgrade to 1.4.3.

    Please see the release notes for 1.4.0 for changes since 1.3.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.4.2(Sep 16, 2018)

    This patch release fixes several issues with the HTTP client and Server Sent Events. Please see the issue list below for details.

    It is strongly recommended that all 1.4.x users upgrade to 1.4.2.

    Please see the release notes for 1.4.0 for changes since 1.3.x.

    Source code(tar.gz)
    Source code(zip)
  • v1.4.1(Sep 16, 2018)

Apache Wicket - Component-based Java web framework

What is Apache Wicket? Apache Wicket is an open source, java, component based, web application framework. With proper mark-up/logic separation, a POJO

The Apache Software Foundation 549 Mar 10, 2021
Bootique is a minimally opinionated platform for modern runnable Java apps.

Bootique is a minimally opinionated java launcher and integration technology. It is intended for building container-less runnable Java applications. W

Bootique Project 1.3k Mar 13, 2021
:rocket: Lightning fast and elegant mvc framework for Java8

Based on Java8 + Netty4 to create a lightweight, high-performance, simple and elegant Web framework ?? Spend 1 hour to learn it to do something intere

Blade Framework 5.5k Mar 9, 2021
:rocket: Lightning fast and elegant mvc framework for Java8

Based on Java8 + Netty4 to create a lightweight, high-performance, simple and elegant Web framework ?? Spend 1 hour to learn it to do something intere

Blade Framework 5.5k Mar 13, 2021
Vaadin 6, 7, 8 is a Java framework for modern Java web applications.

Vaadin Framework Vaadin allows you to build modern web apps efficiently in plain Java, without touching low level web technologies. This repository co

Vaadin 1.7k Apr 24, 2021
True Object-Oriented Java Web Framework

Project architect: @paulodamaso Takes is a true object-oriented and immutable Java8 web development framework. Its key benefits, comparing to all othe

Yegor Bugayenko 669 Mar 12, 2021
Realtime Client Server Framework for the JVM, supporting WebSockets with Cross-Browser Fallbacks

Welcome to Atmosphere: The Event Driven Framework supporting WebSocket and HTTP The Atmosphere Framework contains client and server side components fo

Atmosphere Framework 3.5k Mar 13, 2021
Tiny, easily embeddable HTTP server in Java.

NanoHTTPD – a tiny web server in Java NanoHTTPD is a light-weight HTTP server designed for embedding in other applications, released under a Modified

NanoHttpd 5.8k Mar 14, 2021
jetbrick web mvc framework

jetbrick-webmvc Web MVC framework for jetbrick. Documentation http://subchen.github.io/jetbrick-webmvc/ Dependency <dependency> <groupId>com.githu

Guoqiang Chen 23 Feb 9, 2021
Ultimate Component Suite for JavaServer Faces

PrimeFaces This is an overview page, please visit PrimeFaces.org for more information. Overview PrimeFaces is one of the most popular UI libraries in

PrimeFaces 1.3k Mar 12, 2021
Firefly is an asynchronous web framework for rapid development of high-performance web application.

What is Firefly? Firefly framework is an asynchronous Java web framework. It helps you create a web application Easy and Quickly. It provides asynchro

Alvin Qiu 277 Mar 12, 2021
An Intuitive, Lightweight, High Performance Full Stack Java Web Framework.

mangoo I/O mangoo I/O is a Modern, Intuitive, Lightweight, High Performance Full Stack Java Web Framework. It is a classic MVC-Framework. The foundati

Sven Kubiak 52 Mar 1, 2021
A push library for Tapestry5 based on CometD

A push library for Tapestry5 based on CometD Features: Create push applications without writing a single line of Javascript Fully configurable Use Tap

Lance 17 Sep 2, 2017
A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin

Spark - a tiny web framework for Java 8 Spark 2.9.3 is out!! Changeset <dependency> <groupId>com.sparkjava</groupId> <artifactId>spark-core</a

Per Wendel 9k Mar 13, 2021