A couple of weeks ago during Code Motion Madrid 2015 I could attend to @alvaro_sanchez's workshop : Ratpack 101. Normally I don't link to workshops because they are tough to follow without the speaker help. However he has created a set of exercises with such a level of explanation that you can do the workshop without his assistance.
If you are in GGX he hosts this workshop on Tuesday 11:00 Track 2. Don't miss, it you will get a lot of extra value with his explanations!
Security is a major piece of functionality of almost any app. @beckje01's talk at Greach 2015 helps you understand the security choices at your disposal for a Ratpack app.
- Force SSL and an example of using SSL with Ratpack and AWS.
- Ratpack Sessions and example of how to use the Session Module.
- How to use Pac4j with Ratpack.
Pac4j is a set of components to secure your Java applications ( authentication + authorization).
During the talk, he showcases several examples ( BasicAuth, Twitter Auth, ...)
Check the Slides.
@JacobAae shows how to use GORM outside the Grails world. GORM keeps growing and getting more interesting. It is possible to use in conjunction with other technology pieces such as Ratpack.
Nice to see that @kyleboon got energised in Greach 2016 and continued his Zero To Ratpack blog post series.
Each time I go to a Groovy event, I keep seeing the Ratpack momentum growing. Documentation and tutorials such as this post are key to the framework success.
@ldaley, Ratpack's project lead, explains Ratpack’s execution model.
Machines fundamentally perform tasks asynchronously. Synchronous programming is just an abstraction; a very prevalent and useful one. It allows programmers to reason about an operation as being continuous and deterministic. You give this up with the asynchronous/non-blocking paradigm, and therein the problem begins. What you gain in terms of “performance” you pay for in convenience. At its worst, multithreaded asynchronous programming is completely non deterministic and disjointed. Ratpack tries to bridge the performance/convenience gap via its execution model.
A Promise is an object that will eventually yield or provide a value - often for an asynchronous computation e.g. some kind of network request. Promises are implemented with a fluent interface that allow you to build a chain of actions that will occur when the value of the Promise is yielded.
Promises in Ratpack from a practical perspective.
- How to deal with errors in Promises. How to deal with errors from which we can recover from.
- How to change one promised value to another you can use
- How to intercept the promised value. E.g. logging, or for fire-and-forget operations.
- Combine the promised value with another value
- Bail out of my promise chain early
Another presentation by @LSpacewalker supported by great Asciidoc documentation.
Learn how to do in Ratpack:
- Unit Testing
- Http Client Testing ( http verbs, headers, cookies)
- Async testing
- Functional teting
Nice retrospective of a team with DropWizard expertise adopting
Ratpack by @phill_barber1.
He describes the challenges faced to move to Ratpack’s async paradigm, possible mistakes, etc. Moreover, he describes decisions such as their use Rx Java to avoid coupling with Ratpack into the whole services layer and the problems derived from not going all-in in the framework.
@kyleboon shows an approach to tackle validation in Ratpack.
@beckje01's talk at GR8Conf EU. An overview of Ratpack:
- Ratpack Key points
- Tips about how to structure Ratpack apps ( example: all routing should not live in ratpack.groovy)
- A brief discussion about Testing and specially Functional Testing; thanks to Ratpack fast startup time.
- How to distribute the apps ( he recommends FAT jars)
@Lspacewalker's talk at GR8Conf EU 2017.
Ratpack is async and non-blocking
It provides its own concurrency model (execution model) for managing and handling web requests
@Lspacewalker always provides great material to support his talks: Notes + Code.
Discover Ratpack Async Primitives (e.g. Promises ) and how to test your async code with
In an advanced section, he talks about: Operations, Handling errors, Throttling Promises, Forking execution ...
@micnasti decided to write a microservice with Ratpack. He enumerates Ratpack features and experiences with his adoption.
Brendon Anderson at @objectpartners published a great introduction to Ratpack. Interesting the comparison of Ratpack and SpringBoot threading model. Definitely a great read to familiarise with Ratpack.
@kyleboon began a series of introductory posts (Zero to Ratpack) during the summer. Introduction and Part 2.
If you are following the tutorial today, check out the code in the github repo. The post's code is a bit outdated.
Ask him in twitter to continue the series!. I have no credibility to ask him, since I write a "weekly" newsletter which sometimes takes 20 days between issues.
Grails Guide which explains how to build a Ratpack application which uses GORM as data access toolkit.
A couple of weeks ago, I linked to a guide which showed how to deploy a Grails 3 app into Pivotal Web Services.
Fortunately, the documentation includes as well Ratpack instructions. If you have Ratpack project, PWS is another deployment option for you.
A continuation post to the previously linked blog post where @ldaley explains how you would use Ratpack's execution model in a real application. An important take-away:
As little work as possible should be inside a blocking() call (i.e. on a thread from
the blocking pool). All computation should be done on the event loop.
If you are looking for a set of unordered lists of Ratpack's goals, key features, common use cases, this post on DZone may fulfill that need.
In this free Oreilly video presentation, @danveloper talks ratpack. He covers:
- Why Ratpack supports not just Java but Groovy as a first time citizen.
- Ratpack modules instead of plugins
- Dependency injection ( Guice or Spring Boot )
- Ratpack awesome gradle integration
- Handlers ( A marriage between filters and servlets )
Specially interesting the part where he explains how Ratpack helps to tackle asynchronous.
@andyvdh7 shows how to deploy a Ratpack app to Bluemix. However, it does not detail how to setup and configure the bluemix account.
Moreover I discovered that a Ratpack app will run on 160MB of memory. He sets up a 256MB instance. If the memory footprint is this low, it will make wonders towards Ratpack's adoption.
Interesting post by @phill_barber1 comparing DropWizard against Ratpack. Similar comparisions are happening in other companies to evaluate technology adoption.
He covers the next topics.
- Success responses per second
- Heap Memory Usage
- Process' share of CPU
- Number of threads
- Integration with Hystrix
- Learning Curve
Slides from a talk at UberConf 2016 by @danveloper where he highlights how the combination of technologies such us Ratpack, Groovy Lambda, Sshoogr, Jenkins Job DSL, Spinnaker and Groovy are perfect fit for the cloud.
I was fortunate enough to attend @marcinerdmann's talk at last GR8Days Warsaw. He conveyed a deep a care about testing. He showed how Ratpack's helps you test (GroovyEmbeddedApp, ApplicationUnderTest...) and other cool framework's features such as Impositions.
Checkout the slides and github repository.
@mrhaki shows how to use the @DelegateTo annotation in a Ratpack project to squeeze IntellJ's autocomplete Juice.
We hosts our Grails 3 app in AWS. However Heroku is another great option to host Grails 3 or Ratpack apps (Gradle Apps). Check out their documentation to give you a heads start.
Ratpack apps are easily deployed on Heroku. Ratpack.io is such an app. GitHub source based build and deploy strategy was too slow for the Ratpack project due to size and requirements. @ldaley shows how they have integrated Snap-CI to speed the deployment.
@Lspacewalker talk's documentation is awesome. I've seen frameworks with less documentation. The tutorial explains how to create a Ratpack JSON Api with a database access layer, touches the async capabilities of Ratpack and shows how to deploy the app to heroku. Great for Ratpack newbies such as me.
You can find the code in the talk's Github repo.
Open the Notes and Code while you watch @Lspacewalker's talk at GR8Conf EU 2016.
Write a TODO app backed by a REST API powered by Ratpack. While you build the application, you discover an example of Handlers composition with CORS HTTP-headers, how to use jOOQ to query the datasource, how to wrap blocking code in Promises, how to use Ratpack mechanisms for composing chains to keep your handler code easy to understand and mantain, and how to deploy your app to Heroku.
This interview with project lead developer @ldaley offers a sneak peak into the project motivation and a glimpse into how Luke Daley sees the project:
the combination of great performance with just enough support for building your app how you want to build it
A Grails Guide which shows how easy it is to integrate GORM with Spring Boot. If you are using Grails, GORM is a natural choice. However, if you are using another framework such as Ratpack, Spring Boot, you may consider GORM as a data access toolkit.
AWS now supports running FAT jars as a first-class citizen in Elastic Beanstalk. @musketyr shows the necessary changes in your Gradle build file to streamline your deployment process of Grails, Ratpack ... apps.
Never heard of GraphQL? Don't worry. @marioggar's first part of his talk at Greach explains what GraphQL is and more importantly what it is not. Moreover, you will understand the problem that it is trying to solve.
In the second part of his talk, he introduces GQL (more in next link) and an example of a GraphQL Groovy application using GQL and Ratpack.
Composite builds are a way to join multiple independent Gradle builds and build them together.
This looks really promising. It will encourage to create plugins and modules. Thus, less coupled applications. The Groovy ecosystem will leverage it for sure. Many of the projects ( Grails, Ratpack, Griffon ) can use Gradle as their build system and use plugins or modules.
Moreover, IntelliJ IDEA already supports Gradle Composite builds.
A couple of issues ago I linked to a github repository where @codejennerator shows how to document a Grails 3 app with Spring Rest Docs.
Her talk at GR8Conf US goes beyond that. She shows how to document a Spring Boot, Grails and Ratpack app with Spring Rest Docs.
Most importantly she advocates to add documentation as a integral part of a test driven development approach.
- Your documentation will use live code and thus be up to date.
- You will be encourage to write more tests since it is the path to add documentation.
- You will liberate your app code from annotations whose only aim is to generate API documentation.
@mrkahi shows an example of how Ratpack uses the
@Delegate to improve DSL Code Completion In IntelliJ IDEA.
The @DelegatesTo annotation defines that the delegate of the closure code is the GroovyChain class. IntelliJ IDEA now knows that GroovyChain is used and gives us via the code completion the methods and properties of GroovyChain.
@adamldavis`s book is now available for pre-order!
What You'll Learn
- Grasp Groovy fundamentals, including the GDK or Groovy Development Kit
- Master advanced Groovy, such as writing Groovy DSLs
- Discover functional programming in Groovy
Work with GPars, the built-in concurrency library
- Use Gradle, the build system
- Master Grails, the web application framework
- Work with Spock, the testing framework
- Harness Ratpack, the reactive web library