SlideShare a Scribd company logo
1 of 26
Download to read offline
There’s more to
Ratpack than
non-blocking
Marcin Erdmann
@marcinerdmann
•  Groovy enthusiast since 2010
•  open source contributor
•  Geb lead
•  Ratpack committer
•  testing junkie
•  part of the Energized Work crew
What I won’t talk about
•  Promises
•  Execution model
– http://tinyurl.com/ratpack-execution-1
– http://tinyurl.com/ratpack-execution-2
•  Handlers
•  Handler chains
What I will talk about
•  Development time reloading
•  Deploying to the cloud
•  Testing
•  Configuration
•  Application lifecycle
•  Renderers and parsers
•  Session support
Development time reloading
•  Based on Gradle continuous mode
•  Enabled by –t/--continuous switch
•  Server restart is performed on change
•  Only user classes are reloaded
•  Detects any changes in the build
Demo
01-reloading
Deploying to heroku
•  Given:
– JDK
– Gradle
– Heroku toolbelt
•  In ~7min from zero to deployment
•  Heroku’s Gradle example is a ratpack app
– heroku/gradle-getting-started on github
ApplicationUnderTest
•  SAM interface that provides app URI
•  Has a default method for creating
TestHttpClient pointing at the app
•  Default implementations are lazy
–  MainClassApplicationUnderTest
–  GroovyRatpackMainApplicationUnderTest
•  CloseableApplicationUnderTest
works well with @AutoCleanup
GroovyEmbeddedApp
•  Useful for trying out ideas in the same file
as the test
•  Useful for mocking out external http services
•  Can be used to integration test classes as part of
a running application - Handlers, Chains,
Services, Renderers, Parsers, SessionsStores, etc
Demo
04-embedded-application
Impositions
•  Useful in moulding application under test
•  Allow control over configuration and registries
•  No need to modify production code
•  New in 1.2.0
Configuration
•  Many built in config sources (json, yaml
and property files, environment, system
properties, command line args)
•  Parsed into a tree of Jackson ObjectNodes
•  Mapped into objects that are available
from the registry
•  Mapped using Jackson ObjectMapper
•  Easily changed at test time via imposition
Custom config sources
•  Create your own config source if needed
•  Implement ratpack.config.ConfigSource
•  Add using ServerConfigBuilder.add()
•  Useful when overriding config in tests
Demo
06-custom-config
Remote control
•  Useful for gray box testing
•  Useful when setting up internal state
before test
•  Useful when verification of state would be
tedious if using app’s public interfaces
•  Built in support in Ratpack
•  Easily enabled in tests via imposition
Renderers
•  Strategy classes for rendering http
responses from different objects
•  Used with Context.render(Object)
•  Builtin renderers for CharSequence, Path,
json, Promise, Renderable, various
templates
•  Add your own by implementing Renderer
or extending RendererSupport
Demo
08-renderers
RenderableDecorator
•  Allow to decorate rendered objects
•  Sit between Context.render(Object)
Renderer.render(Context, Object)
•  Useful for adding default values to
template models
•  Add your own by implementing
RenderableDecorator or extending
RenderableDecoratorSupport
Parsers
•  Strategy classes for parsing http requests
into objects
•  Used with Context.parse(Class)
•  Builtin renderers for json and http forms
•  Add your own by implementing Parser or
extending ParserSupport
Sessions
•  Designed with support for distributed
sessions in mind
•  Built-in store implementations: in
memory, cookie based, redis backed
•  Build your own – file backed store example
in javadoc for SessionStore interface
Sessions
•  By default serialized using Java
serialization
•  Customize by implementing
SessionSerializer and putting it in the
registry
Services
•  Can participate in application lifecycle
–  onStart(StartEvent)
–  onStop(StopEvent)
•  Implement ratpack.server.Service
•  Put them in registry
Integrate over abstract
•  ratpack-tymeleaf, ratpack-handlebars vs
ratpack-template
•  ratpack-hikari vs ratpack-connection-pool
•  ratpack-pac4j vs ratpack-security
•  ratpack-dropwizard-metrics,
ratpack-hystrix, ratpack-rx
•  registry is abstracted hence Ratpack can be
used with Guice, Spring or none
•  good strategy if you’re in for a long run
#unfollowdanveloper
Summary
Questions?

More Related Content

What's hot

Arquillian & Citrus
Arquillian & CitrusArquillian & Citrus
Arquillian & Citruschristophd
 
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015Alvaro Sanchez-Mariscal
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)Dave Haeffner
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersRudy De Busscher
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React AppAll Things Open
 
Hadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoopHadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoopWisely chen
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Previewgraemerocher
 
Rapid application development with spring roo j-fall 2010 - baris dere
Rapid application development with spring roo   j-fall 2010 - baris dereRapid application development with spring roo   j-fall 2010 - baris dere
Rapid application development with spring roo j-fall 2010 - baris dereBaris Dere
 
Java 9 Functionality and Tooling
Java 9 Functionality and ToolingJava 9 Functionality and Tooling
Java 9 Functionality and ToolingTrisha Gee
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereStrannik_2013
 
Building reliable web applications using Cypress
Building reliable web applications using CypressBuilding reliable web applications using Cypress
Building reliable web applications using CypressMaurice De Beijer [MVP]
 
Coscup 2013 : Continuous Integration on top of hadoop
Coscup 2013 : Continuous Integration on top of hadoopCoscup 2013 : Continuous Integration on top of hadoop
Coscup 2013 : Continuous Integration on top of hadoopWisely chen
 
Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Trisha Gee
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworksKirk Madera
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupalarithmetric
 
Capybara testing
Capybara testingCapybara testing
Capybara testingFutureworkz
 
Jasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScriptJasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScriptSumanth krishna
 
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...NCCOMMS
 
Blazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseBlazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseMichał Kordas
 
Queick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for PythonQueick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for PythonRyota Suenaga
 

What's hot (20)

Arquillian & Citrus
Arquillian & CitrusArquillian & Citrus
Arquillian & Citrus
 
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015Efficient HTTP applications on the JVM with Ratpack - JDD 2015
Efficient HTTP applications on the JVM with Ratpack - JDD 2015
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Finally, easy integration testing with Testcontainers
Finally, easy integration testing with TestcontainersFinally, easy integration testing with Testcontainers
Finally, easy integration testing with Testcontainers
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
Hadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoopHadoop Summit 2013 : Continuous Integration on top of hadoop
Hadoop Summit 2013 : Continuous Integration on top of hadoop
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
Rapid application development with spring roo j-fall 2010 - baris dere
Rapid application development with spring roo   j-fall 2010 - baris dereRapid application development with spring roo   j-fall 2010 - baris dere
Rapid application development with spring roo j-fall 2010 - baris dere
 
Java 9 Functionality and Tooling
Java 9 Functionality and ToolingJava 9 Functionality and Tooling
Java 9 Functionality and Tooling
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhere
 
Building reliable web applications using Cypress
Building reliable web applications using CypressBuilding reliable web applications using Cypress
Building reliable web applications using Cypress
 
Coscup 2013 : Continuous Integration on top of hadoop
Coscup 2013 : Continuous Integration on top of hadoopCoscup 2013 : Continuous Integration on top of hadoop
Coscup 2013 : Continuous Integration on top of hadoop
 
Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)Refactoring to Java 8 (QCon New York)
Refactoring to Java 8 (QCon New York)
 
They why behind php frameworks
They why behind php frameworksThey why behind php frameworks
They why behind php frameworks
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupal
 
Capybara testing
Capybara testingCapybara testing
Capybara testing
 
Jasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScriptJasmine - A BDD test framework for JavaScript
Jasmine - A BDD test framework for JavaScript
 
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
O365Con18 - Implementing Automated UI Testing for SharePoint Solutions - Elio...
 
Blazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java UniverseBlazing Fast Feedback Loops in the Java Universe
Blazing Fast Feedback Loops in the Java Universe
 
Queick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for PythonQueick: A Simple Job Queue System for Python
Queick: A Simple Job Queue System for Python
 

Viewers also liked

Using the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentUsing the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentSchalk Cronjé
 
Docker and jvm. A good idea?
Docker and jvm. A good idea?Docker and jvm. A good idea?
Docker and jvm. A good idea?Christopher Batey
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web FrameworksJoe Kutner
 
закон україни про охорону праці
закон україни про охорону працізакон україни про охорону праці
закон україни про охорону праціОльга Радіонова
 
Samhällsekonomiska effekter öppna geodata - studie på väg
Samhällsekonomiska effekter öppna geodata - studie på vägSamhällsekonomiska effekter öppna geodata - studie på väg
Samhällsekonomiska effekter öppna geodata - studie på vägSusanne Nellemann Ek
 
Trabajo edwin choque aduviri
Trabajo edwin choque aduviriTrabajo edwin choque aduviri
Trabajo edwin choque aduviriEdwin choque
 
öPpna geodata vart är vi på väg
öPpna geodata   vart är vi på vägöPpna geodata   vart är vi på väg
öPpna geodata vart är vi på vägSusanne Nellemann Ek
 
CV - Mubeen Malik 2016
CV - Mubeen Malik 2016CV - Mubeen Malik 2016
CV - Mubeen Malik 2016Mubeen Malik
 
CU Times e-closing story
CU Times e-closing storyCU Times e-closing story
CU Times e-closing storyLisa Burden
 
нормативні акти з охорони праці
нормативні акти з охорони працінормативні акти з охорони праці
нормативні акти з охорони праціОльга Радіонова
 
Ведення колективних переговорів з укладанням генеральної угоди
Ведення колективних переговорів з укладанням генеральної угодиВедення колективних переговорів з укладанням генеральної угоди
Ведення колективних переговорів з укладанням генеральної угодиОльга Радіонова
 
James-Dissertation
James-DissertationJames-Dissertation
James-DissertationJames Strutt
 
надання першої допомоги потерпілим
надання першої допомоги потерпілим надання першої допомоги потерпілим
надання першої допомоги потерпілим Ольга Радіонова
 
Synerta Transport: Sluzby v osobnej doprave
Synerta Transport: Sluzby v osobnej dopraveSynerta Transport: Sluzby v osobnej doprave
Synerta Transport: Sluzby v osobnej dopraveSynerta Transport
 
Tarea seminario
Tarea seminario Tarea seminario
Tarea seminario natsanco
 
El oso panda sobrevive
El oso panda sobreviveEl oso panda sobrevive
El oso panda sobreviveROSA PAREDES
 

Viewers also liked (20)

Using the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM DevelopmentUsing the Groovy Ecosystem for Rapid JVM Development
Using the Groovy Ecosystem for Rapid JVM Development
 
Docker and jvm. A good idea?
Docker and jvm. A good idea?Docker and jvm. A good idea?
Docker and jvm. A good idea?
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 
Presentation Chappi
Presentation ChappiPresentation Chappi
Presentation Chappi
 
закон україни про охорону праці
закон україни про охорону працізакон україни про охорону праці
закон україни про охорону праці
 
презентация2
презентация2презентация2
презентация2
 
Samhällsekonomiska effekter öppna geodata - studie på väg
Samhällsekonomiska effekter öppna geodata - studie på vägSamhällsekonomiska effekter öppna geodata - studie på väg
Samhällsekonomiska effekter öppna geodata - studie på väg
 
Trabajo edwin choque aduviri
Trabajo edwin choque aduviriTrabajo edwin choque aduviri
Trabajo edwin choque aduviri
 
öPpna geodata vart är vi på väg
öPpna geodata   vart är vi på vägöPpna geodata   vart är vi på väg
öPpna geodata vart är vi på väg
 
CV - Mubeen Malik 2016
CV - Mubeen Malik 2016CV - Mubeen Malik 2016
CV - Mubeen Malik 2016
 
CU Times e-closing story
CU Times e-closing storyCU Times e-closing story
CU Times e-closing story
 
нормативні акти з охорони праці
нормативні акти з охорони працінормативні акти з охорони праці
нормативні акти з охорони праці
 
eh
eheh
eh
 
Ведення колективних переговорів з укладанням генеральної угоди
Ведення колективних переговорів з укладанням генеральної угодиВедення колективних переговорів з укладанням генеральної угоди
Ведення колективних переговорів з укладанням генеральної угоди
 
EMDRreferal2016
EMDRreferal2016EMDRreferal2016
EMDRreferal2016
 
James-Dissertation
James-DissertationJames-Dissertation
James-Dissertation
 
надання першої допомоги потерпілим
надання першої допомоги потерпілим надання першої допомоги потерпілим
надання першої допомоги потерпілим
 
Synerta Transport: Sluzby v osobnej doprave
Synerta Transport: Sluzby v osobnej dopraveSynerta Transport: Sluzby v osobnej doprave
Synerta Transport: Sluzby v osobnej doprave
 
Tarea seminario
Tarea seminario Tarea seminario
Tarea seminario
 
El oso panda sobrevive
El oso panda sobreviveEl oso panda sobrevive
El oso panda sobrevive
 

Similar to There's more to Ratpack than non-blocking

KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfQA or the Highway
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulMert Çalışkan
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenMert Çalışkan
 
Gerrit + Jenkins = Continuous Delivery For Big Data
Gerrit + Jenkins = Continuous Delivery For Big DataGerrit + Jenkins = Continuous Delivery For Big Data
Gerrit + Jenkins = Continuous Delivery For Big DataStefano Galarraga
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC DeploymentsSujit Kumar
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanthRavikanth Chaganti
 
Staying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsStaying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsVagif Abilov
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.xSam Brannen
 
Integration Testing Practice using Perl
Integration Testing Practice using PerlIntegration Testing Practice using Perl
Integration Testing Practice using PerlMasaki Nakagawa
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZFRalph Schindler
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Provectus
 
Testing with Spring: An Introduction
Testing with Spring: An IntroductionTesting with Spring: An Introduction
Testing with Spring: An IntroductionSam Brannen
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development PipelineGlobalLogic Ukraine
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersGrace Jansen
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOpsEklove Mohan
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityGeoff Harcourt
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gatesStrannik_2013
 

Similar to There's more to Ratpack than non-blocking (20)

KrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdfKrishnaToolComparisionPPT.pdf
KrishnaToolComparisionPPT.pdf
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
 
Gerrit + Jenkins = Continuous Delivery For Big Data
Gerrit + Jenkins = Continuous Delivery For Big DataGerrit + Jenkins = Continuous Delivery For Big Data
Gerrit + Jenkins = Continuous Delivery For Big Data
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
 
Devops
DevopsDevops
Devops
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
 
Staying Close to Experts with Executable Specifications
Staying Close to Experts with Executable SpecificationsStaying Close to Experts with Executable Specifications
Staying Close to Experts with Executable Specifications
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.x
 
Integration Testing Practice using Perl
Integration Testing Practice using PerlIntegration Testing Practice using Perl
Integration Testing Practice using Perl
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZF
 
Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"Сергей Моренец: "Gradle. Write once, build everywhere"
Сергей Моренец: "Gradle. Write once, build everywhere"
 
Testing with Spring: An Introduction
Testing with Spring: An IntroductionTesting with Spring: An Introduction
Testing with Spring: An Introduction
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
 
JLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containersJLove - Replicating production on your laptop using the magic of containers
JLove - Replicating production on your laptop using the magic of containers
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gates
 

Recently uploaded

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 

Recently uploaded (20)

The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 

There's more to Ratpack than non-blocking

  • 1. There’s more to Ratpack than non-blocking Marcin Erdmann
  • 2. @marcinerdmann •  Groovy enthusiast since 2010 •  open source contributor •  Geb lead •  Ratpack committer •  testing junkie •  part of the Energized Work crew
  • 3. What I won’t talk about •  Promises •  Execution model – http://tinyurl.com/ratpack-execution-1 – http://tinyurl.com/ratpack-execution-2 •  Handlers •  Handler chains
  • 4. What I will talk about •  Development time reloading •  Deploying to the cloud •  Testing •  Configuration •  Application lifecycle •  Renderers and parsers •  Session support
  • 5. Development time reloading •  Based on Gradle continuous mode •  Enabled by –t/--continuous switch •  Server restart is performed on change •  Only user classes are reloaded •  Detects any changes in the build
  • 7. Deploying to heroku •  Given: – JDK – Gradle – Heroku toolbelt •  In ~7min from zero to deployment •  Heroku’s Gradle example is a ratpack app – heroku/gradle-getting-started on github
  • 8. ApplicationUnderTest •  SAM interface that provides app URI •  Has a default method for creating TestHttpClient pointing at the app •  Default implementations are lazy –  MainClassApplicationUnderTest –  GroovyRatpackMainApplicationUnderTest •  CloseableApplicationUnderTest works well with @AutoCleanup
  • 9. GroovyEmbeddedApp •  Useful for trying out ideas in the same file as the test •  Useful for mocking out external http services •  Can be used to integration test classes as part of a running application - Handlers, Chains, Services, Renderers, Parsers, SessionsStores, etc
  • 11. Impositions •  Useful in moulding application under test •  Allow control over configuration and registries •  No need to modify production code •  New in 1.2.0
  • 12. Configuration •  Many built in config sources (json, yaml and property files, environment, system properties, command line args) •  Parsed into a tree of Jackson ObjectNodes •  Mapped into objects that are available from the registry •  Mapped using Jackson ObjectMapper •  Easily changed at test time via imposition
  • 13. Custom config sources •  Create your own config source if needed •  Implement ratpack.config.ConfigSource •  Add using ServerConfigBuilder.add() •  Useful when overriding config in tests
  • 15. Remote control •  Useful for gray box testing •  Useful when setting up internal state before test •  Useful when verification of state would be tedious if using app’s public interfaces •  Built in support in Ratpack •  Easily enabled in tests via imposition
  • 16. Renderers •  Strategy classes for rendering http responses from different objects •  Used with Context.render(Object) •  Builtin renderers for CharSequence, Path, json, Promise, Renderable, various templates •  Add your own by implementing Renderer or extending RendererSupport
  • 18. RenderableDecorator •  Allow to decorate rendered objects •  Sit between Context.render(Object) Renderer.render(Context, Object) •  Useful for adding default values to template models •  Add your own by implementing RenderableDecorator or extending RenderableDecoratorSupport
  • 19. Parsers •  Strategy classes for parsing http requests into objects •  Used with Context.parse(Class) •  Builtin renderers for json and http forms •  Add your own by implementing Parser or extending ParserSupport
  • 20. Sessions •  Designed with support for distributed sessions in mind •  Built-in store implementations: in memory, cookie based, redis backed •  Build your own – file backed store example in javadoc for SessionStore interface
  • 21. Sessions •  By default serialized using Java serialization •  Customize by implementing SessionSerializer and putting it in the registry
  • 22. Services •  Can participate in application lifecycle –  onStart(StartEvent) –  onStop(StopEvent) •  Implement ratpack.server.Service •  Put them in registry
  • 23. Integrate over abstract •  ratpack-tymeleaf, ratpack-handlebars vs ratpack-template •  ratpack-hikari vs ratpack-connection-pool •  ratpack-pac4j vs ratpack-security •  ratpack-dropwizard-metrics, ratpack-hystrix, ratpack-rx •  registry is abstracted hence Ratpack can be used with Guice, Spring or none •  good strategy if you’re in for a long run