SlideShare a Scribd company logo
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 & Citrus
christophd
 
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
Alvaro 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 Testcontainers
Rudy 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 App
All 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 hadoop
Wisely chen
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
graemerocher
 
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
Baris Dere
 
Java 9 Functionality and Tooling
Java 9 Functionality and ToolingJava 9 Functionality and Tooling
Java 9 Functionality and Tooling
Trisha Gee
 
Gradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhereGradle 2.Write once, builde everywhere
Gradle 2.Write once, builde everywhere
Strannik_2013
 
Building reliable web applications using Cypress
Building reliable web applications using CypressBuilding reliable web applications using Cypress
Building reliable web applications using Cypress
Maurice 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 hadoop
Wisely 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 frameworks
Kirk Madera
 
Using Grunt with Drupal
Using Grunt with DrupalUsing Grunt with Drupal
Using Grunt with Drupal
arithmetric
 
Capybara testing
Capybara testingCapybara testing
Capybara testing
Futureworkz
 
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
Sumanth 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 Universe
Michał 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 Python
Ryota 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 Development
Schalk 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 Frameworks
Joe Kutner
 
Presentation Chappi
Presentation ChappiPresentation Chappi
Presentation Chappi
Kostya Zlobin
 
закон україни про охорону праці
закон україни про охорону працізакон україни про охорону праці
закон україни про охорону праці
Ольга Радіонова
 
презентация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
Susanne Nellemann Ek
 
Trabajo edwin choque aduviri
Trabajo edwin choque aduviriTrabajo edwin choque aduviri
Trabajo edwin choque aduviri
Edwin 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äg
Susanne Nellemann Ek
 
CV - Mubeen Malik 2016
CV - Mubeen Malik 2016CV - Mubeen Malik 2016
CV - Mubeen Malik 2016
Mubeen Malik
 
CU Times e-closing story
CU Times e-closing storyCU Times e-closing story
CU Times e-closing storyLisa Burden
 
нормативні акти з охорони праці
нормативні акти з охорони працінормативні акти з охорони праці
нормативні акти з охорони праці
Ольга Радіонова
 
eh
eheh
Ведення колективних переговорів з укладанням генеральної угоди
Ведення колективних переговорів з укладанням генеральної угодиВедення колективних переговорів з укладанням генеральної угоди
Ведення колективних переговорів з укладанням генеральної угоди
Ольга Радіонова
 
EMDRreferal2016
EMDRreferal2016EMDRreferal2016
EMDRreferal2016
Donald Charnock
 
James-Dissertation
James-DissertationJames-Dissertation
James-Dissertation
James Strutt
 
надання першої допомоги потерпілим
надання першої допомоги потерпілим надання першої допомоги потерпілим
надання першої допомоги потерпілим
Ольга Радіонова
 
Synerta Transport: Sluzby v osobnej doprave
Synerta Transport: Sluzby v osobnej dopraveSynerta Transport: Sluzby v osobnej doprave
Synerta Transport: Sluzby v osobnej doprave
Synerta Transport
 
Tarea seminario
Tarea seminario Tarea seminario
Tarea seminario
natsanco
 
El oso panda sobrevive
El oso panda sobreviveEl oso panda sobrevive
El oso panda sobrevive
ROSA 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.pdf
QA or the Highway
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
Jeevesh Pandey
 
Intelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest IstanbulIntelligent Projects with Maven - DevFest Istanbul
Intelligent Projects with Maven - DevFest Istanbul
Mert Çalışkan
 
BMO - Intelligent Projects with Maven
BMO - Intelligent Projects with MavenBMO - Intelligent Projects with Maven
BMO - Intelligent Projects with Maven
Mert Ç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 Data
Stefano Galarraga
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
Sujit Kumar
 
Power shell saturday ravikanth
Power shell saturday  ravikanthPower shell saturday  ravikanth
Power shell saturday ravikanth
Ravikanth Chaganti
 
Devops
DevopsDevops
Devops
JyothirmaiG4
 
DevOps: Infrastructure as Code
DevOps: Infrastructure as CodeDevOps: Infrastructure as Code
DevOps: Infrastructure as Code
Julio Aziz Flores Casab
 
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
Vagif Abilov
 
Testing with Spring 4.x
Testing with Spring 4.xTesting with Spring 4.x
Testing with Spring 4.x
Sam Brannen
 
Integration Testing Practice using Perl
Integration Testing Practice using PerlIntegration Testing Practice using Perl
Integration Testing Practice using Perl
Masaki Nakagawa
 
Extending ZF & Extending With ZF
Extending ZF & Extending With ZFExtending ZF & Extending With ZF
Extending ZF & Extending With ZF
Ralph 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 Introduction
Sam Brannen
 
Modern Web-site Development Pipeline
Modern Web-site Development PipelineModern Web-site Development Pipeline
Modern Web-site Development Pipeline
GlobalLogic 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 containers
Grace Jansen
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
Eklove Mohan
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
Geoff Harcourt
 
Gradle.Enemy at the gates
Gradle.Enemy at the gatesGradle.Enemy at the gates
Gradle.Enemy at the gates
Strannik_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

SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 

Recently uploaded (20)

SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 

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