SlideShare a Scribd company logo
Groovy with
Dropwizard	

for high performance
and reliable web
services
Tomas Lin @tomaslin
!

Goals for this talk

• Quick tour of Dropwizard functionality

written with Groovy & friends instead of
pure Java.	


• Showcase some of the “DevOps” friendly
features in Dropwizard for easy setup,
deployment and monitoring.
This is not a talk about
REST Services
• Everything I tell you about REST will
probably be a lie. 	


• Think JSON services over http.
REST Services
REST-ful API Design - Ben Hale
https://github.com/nebhale/spring-one-2013/tree/master/
rest-ful-api-design
Beautiful REST + JSON APIs - Les Hazlewood
http://www.slideshare.net/stormpath/rest-jsonapis
whoami

• Senior Software Engineer at Netflix

• Grails developer since 2008
What is Dropwizard?
http://gunshowcomic.com/316
http://www.dropwizard.io
Dropwizard stack
• Takes mature, well known Java frameworks
and glues them together. 	


• Jetty for HTTP	

• Jersey for REST	

• Jackson for JSON	

• Metrics for metrics	

• Etc. ( Logback, Hibernate, Liquibase, etc )
Additional Integrations
• Scala	

• Views ( Freemaker / Mustache )	

• Liquibase migrations	

• Authentication ( http and oAuth2 )	

• Dropwizard Spring - https://github.com/
SindicatoSource/dropwizard-spring
Who uses Dropwizard?
Fraud Detection & Gift Card
Services
Fault Tolerant Job Scheduler	

https://github.com/airbnb/chronos
Carl Quinn : Dropwizard +
Netflix OSS tools	

http://tekconf.com/conferences/
codemash-2014/how-we-built-acloud-platform-at-riot-games-u
Dropwizard + Groovy?
• Bloom Health - Insurance carriers data exchange.

Spring Batch, Dropwizard and Groovy.

(25x faster than previous system)	


• Sky Find and Watch - Powers the remote record /
watch now functionality	


• UnderwriteMe - Watch Marcin’s talk!


http://skillsmatter.com/podcast/home/moderngroovy-enterprise-stack
Dropwizard + Groovy?
• Editorial Expansion - Time inc. subsidiary in Mexico 

Gourmet Awards iPhone app backend.
Why should I try	

Dropwizard?
Enable Service
Oriented Architecture
Advantages
• Scale up only some parts of your
application.	


• Isolate services based depending on their
security profiles.	


• Fault tolerance.	

• Cloud friendly!
vs.

—-

+
vs.

—-

+
Dropwizard with Grails at Sky Find and Watch
Performance
Dropwizard is a very high performance, low latency
framework.

http://www.techempower.com/benchmarks/
Other niceties

• Testable. Every part of the system can be
tested during development.	


• Deployment friendly - easy to configure,
deploy and monitor. 	


• Pure Java.
Getting Started	

with Dropwizard 	

and Groovy
Lazybones Starter
Template
• By Kyle Boon from Bloom Health	

• Available via Lazybones template tool by
Peter Ledbrook	


• You can get Lazybones via gvm
Lazybones Starter
Template
• Gradle build	

• Spock tests	

• Hibernate persistance layer	

• Fat Jars via Shadow ( like Maven’s Shade )	

• CodeNarc for clean code	

• Cobertura for test coverage
Tasks
• Test the application ./gradlew test	

• Build a Jar file for deploy ./gradlew shadow
• Drop a database ./gradlew dropAll 	

• Setup database ./gradlew migrate	

• You can add your own like deployToCloud
Parts of a Dropwizard 	

Application
Banner	


src/main/resources/banner.txt
Services
• Like an Application in Grails	

• Central place where all the other building
blocks are connected.
Services
• The Dropwizard approach to services lets

us see one place where all our other
components are bound and glued together.	


• Relationships between other parts must be
explicitly declared. There is no magic
linking.
Configurations	


• Each service has a configuration that is
passed into the run method. 	


• Dropwizard has default configurations for
clients, logging and Jetty that can be
overwritten
Configurations
Same jar file, configuration is externalized.	

!

java -jar application.jar server test.yml	

java -jar application.jar server stage.yml	

java -jar application.jar server prod.yml
Configurations	

gradleplugins/src/main/groovy/com/tomaslin/gradleplugins/	

GradlePluginsConfiguration.groovy
Configurations
Configurations
Configurations	

add to .yml file
Configuration
• Mapped by Jackson. Uses Hibernate Validator.	

• @Max / @Min	

• @NotNull	

• @Size(min=0, max=50)	

• @Pattern(regex=, flag=)	

• @Future / @Past	

• @NotEmpty	

• @CreditCardNumber
http://docs.jboss.org/hibernate/validator/4.2/reference/enUS/html_single/#validator-defineconstraints-builtin
Nesting Configurations
vs. Java version
Configurations	

• Configurations are vital because they allow
us to make sure we got all the details for
our service right.	


• One config file instead of merged conflict

from many sources eliminates confusion
and makes it easy to automate / swap out.
Resources	

• Represent a set of service endpoints	

• Like Controllers in Grails	

• They are just Jersey Resources:




https://jersey.java.net/nonav/documentation/
latest/user-guide.html#jaxrs-resources
Resource
Resources
• @GET, @POST, @PUT, @DELETE,
@HEAD, @OPTIONS, and even
@HttpMethod	


• @Path("/{user}/notifications")


@PathParam("user") LongParam userId,
@QueryParam("count")
@DefaultValue("20") IntParam count
Resources
Resources
• Tested not as Unit mocks, but as Jersey
components with a real Jersey server.	


• Similar to the FakeServer in Grails Rest Client	

• Dropwizard comes with a ResourceTest that
works with Mockito / JUnit	


• I wrote a Spock equivalent available at http://

fbflex.wordpress.com/2013/01/30/dropwizardwith-spock-and-groov/
Resources
In your IDE
Representations	


• Lets you formally describe the data flowing
in and out of your REST API. 	


• Data Transfer Objects that can be validated.	

• It gives you a way to easily map them into
your database objects either directly or via
a DAO.	


• Recommended approach is to share

representations between servers and
clients.
Representations
• The use of representations ensure the

contract between our REST endpoints and
clients that consume this endpoint.	


• You could also just skip this and go straight
to your other endpoints or JSON friendly
database.
Caching
Metrics

• Uses Coda Hale’s own Metrics Library	

• Integrates with JMX, http, Ganglia and
Graphite
Metrics
@Timed - duration and rate of events	

@Metered - rate of events	

@ExceptionMetered - rate of exceptions
Metrics
Kim Betti
Dropwizard
Dashboard with
Vert.x
https://github.com/
kimble/
dropwizarddashboard
Metrics
• They are first class citizens within
Dropwizard.	


• Very flexible.You can define custom
metrics, set Gauges, etc. 	


• It’s about communicating the actual state of
your server back to the mothership so it
can be coordinated.
Logging
• Dropwizard has a pretty robust default
logging configuration.
Logging
• We can use the @Slf4j annotation in Groovy
Logging
Logging
• I am lazy.	

• Don’t realize logs are needed until it is too
late.	


• Logs are time machines to past

malfunctions, making them easy to set up
allows us to use them.
Client Support
• Dropwizard has available both the Apache
HttpClient and the Jersey Client.	


• Jersey Client can use same deserialization
available to the server
We can now use the client within the
Resource to fetch http data from other sources
Clients
• Returns a fully wrapped object that emits
metrics. This allows us to monitor how
they are used and identify bottlenecks or
bugs.
Managed Objects
• Classes that have a start and end phase
attached to the service.	


• Often have their own configurations.	

• Easy way to encapsulate integrations into
other services / systems.
Health Checks
• Runtime checks that the service is
operating correctly	


• If an exception is thrown, this is shown on
the health monitoring screen	


• Also throws a 500 error code on the
health check page for tools
Health Checks
• Quick diagnostics on running instance.	

• Better to kill a sick service than to keep it
running and potentially corrupting your
data. 	


• Also helps when you are deploying and
building out your infrastructure.
Other Features
• Tasks - Like Grails Scripts	

• Commands - Jobs that can be invoked via
an URL. Lots of power since you’re using
the same stack as your runtime service. 	


• Others - Filters, Bundles, etc.
http://www.dropwizard.io/manual/
Deployment
Make Jars, not Wars
One jar file from CI to deploy
Deploying Dropwizard	

java $JAVA_OPTS -Ddw.http.port=$PORT 	

-Ddw.http.adminPort=$PORT -jar application.jar 	

server prod.yml
Grails Equivalents
• Dropwizard Plugin by Burt Beckwith

http://grails.org/plugin/dropwizard	


• Health Control Plugin by Kim Betti 


http://grails.org/plugin/health-control	


• Validate Config Plugin by Andy Miller


http://grails.org/plugin/validate-config	


• Metrics Plugin by Jeff Ellis


http://grails.org/plugin/yammer-metrics
Using Groovy
• Less verbose objects. Can use map
constructors.	


• Nice annotations for logging.	

• Gradle / Spock / Betamax / Lazybones.	

• Not sure if @CompileStatic has any changes
that are significant - 6%

[ http://kyleboon.org/blog/2013/09/26/doescompile-static-make-your-website-faster/ ]
Development
• A lot faster since there is very little magic
and user interface to test.	


• Excellent support in IntelliJ for Gradle
project and tasks.
Final Thoughts
• Think about the deployed application. 	

• Grails + Dropwizard. Not Grails or
Dropwizard.	


• This is just mini-scale. What happens when
you have 100 services/servers? 1,000?
1,000,000? ( Come work at Netflix! )
Thank you
• Email : tomaslin@gmail.com	

• Twitter : @tomaslin	

• Slides will be posted on my blog:	

• http://bit.ly/tomaslin

More Related Content

What's hot

My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
GR8Conf
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksMike Hugo
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012kennethaliu
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
Joe Kutner
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
Anthony Chen
 
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging PlatformsGame of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
VMware Tanzu
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
Zachary Klein
 
Code Reviews vs. Pull Requests
Code Reviews vs. Pull RequestsCode Reviews vs. Pull Requests
Code Reviews vs. Pull Requests
Atlassian
 
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
DynamicInfraDays
 
Greach 2014 - Road to Grails 3.0
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0
graemerocher
 
Spring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuSpring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFu
VMware Tanzu
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
Virtual JBoss User Group
 
Arquillian & Citrus
Arquillian & CitrusArquillian & Citrus
Arquillian & Citrus
christophd
 
Implementing your own Google App Engine
Implementing your own Google App Engine Implementing your own Google App Engine
Implementing your own Google App Engine
Virtual JBoss User Group
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
VMware Tanzu
 
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
NAVER D2
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
Ryan Cuprak
 
Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
rajdeep
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
Atlassian
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
Yevgeniy Brikman
 

What's hot (20)

My "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails ProjectsMy "Perfect" Toolchain Setup for Grails Projects
My "Perfect" Toolchain Setup for Grails Projects
 
Building Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And TricksBuilding Grails Plugins - Tips And Tricks
Building Grails Plugins - Tips And Tricks
 
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
Modularizing your Grails Application with Private Plugins - SpringOne 2GX 2012
 
4 JVM Web Frameworks
4 JVM Web Frameworks4 JVM Web Frameworks
4 JVM Web Frameworks
 
Dropwizard Introduction
Dropwizard IntroductionDropwizard Introduction
Dropwizard Introduction
 
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging PlatformsGame of Streams: How to Tame and Get the Most from Your Messaging Platforms
Game of Streams: How to Tame and Get the Most from Your Messaging Platforms
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
 
Code Reviews vs. Pull Requests
Code Reviews vs. Pull RequestsCode Reviews vs. Pull Requests
Code Reviews vs. Pull Requests
 
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
ContainerDays NYC 2016: "OpenWhisk: A Serverless Computing Platform" (Rodric ...
 
Greach 2014 - Road to Grails 3.0
Greach 2014  - Road to Grails 3.0Greach 2014  - Road to Grails 3.0
Greach 2014 - Road to Grails 3.0
 
Spring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFuSpring Boot Revisited with KoFu and JaFu
Spring Boot Revisited with KoFu and JaFu
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 
Arquillian & Citrus
Arquillian & CitrusArquillian & Citrus
Arquillian & Citrus
 
Implementing your own Google App Engine
Implementing your own Google App Engine Implementing your own Google App Engine
Implementing your own Google App Engine
 
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
The Making of the Oracle R2DBC Driver and How to Take Your Code from Synchron...
 
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
[1D1]신개념 N스크린 웹 앱 프레임워크 PARS
 
Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)Why jakarta ee matters (ConFoo 2021)
Why jakarta ee matters (ConFoo 2021)
 
Aura Framework Overview
Aura Framework OverviewAura Framework Overview
Aura Framework Overview
 
Unleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket CloudUnleashing Docker with Pipelines in Bitbucket Cloud
Unleashing Docker with Pipelines in Bitbucket Cloud
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 

Viewers also liked

A Common API & UI for Building Next Generation Identity Services
A Common API & UI for Building Next Generation Identity ServicesA Common API & UI for Building Next Generation Identity Services
A Common API & UI for Building Next Generation Identity Services
ForgeRock
 
Dropwizard
DropwizardDropwizard
Dropwizard
Scott Leberknight
 
Java application monitoring with Dropwizard Metrics and graphite
Java application monitoring with Dropwizard Metrics and graphite Java application monitoring with Dropwizard Metrics and graphite
Java application monitoring with Dropwizard Metrics and graphite
Roberto Franchini
 
Upload files with grails
Upload files with grailsUpload files with grails
Upload files with grails
Eric Berry
 
Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011
sullis
 
Dropwizard at Yammer
Dropwizard at YammerDropwizard at Yammer
Dropwizard at YammerJamie Furness
 
Dropwizard
DropwizardDropwizard
Soa with consul
Soa with consulSoa with consul
Soa with consul
Rajesh Sharma
 
JEE on DC/OS
JEE on DC/OSJEE on DC/OS
JEE on DC/OS
Josef Adersberger
 
Production Ready Web Services with Dropwizard
Production Ready Web Services with DropwizardProduction Ready Web Services with Dropwizard
Production Ready Web Services with Dropwizard
sullis
 
Groovy Tutorial
Groovy TutorialGroovy Tutorial
Groovy Tutorial
Paul King
 
Metrics by coda hale : to know your app’ health
Metrics by coda hale : to know your app’ healthMetrics by coda hale : to know your app’ health
Metrics by coda hale : to know your app’ health
Izzet Mustafaiev
 
WildFly Swarm: Criando Microservices com Java EE 7
WildFly Swarm: Criando Microservices com Java EE 7WildFly Swarm: Criando Microservices com Java EE 7
WildFly Swarm: Criando Microservices com Java EE 7
George Gastaldi
 
Simple REST-APIs with Dropwizard and Swagger
Simple REST-APIs with Dropwizard and SwaggerSimple REST-APIs with Dropwizard and Swagger
Simple REST-APIs with Dropwizard and Swagger
LeanIX GmbH
 
Deep Dive on Microservices
Deep Dive on MicroservicesDeep Dive on Microservices
Deep Dive on Microservices
Amazon Web Services
 
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
Daniel Bryant
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECS
Amazon Web Services
 
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through ScriptingWebinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
ForgeRock
 
Dev Ops Geek Fest: Automating the ForgeRock Platform
Dev Ops Geek Fest: Automating the ForgeRock PlatformDev Ops Geek Fest: Automating the ForgeRock Platform
Dev Ops Geek Fest: Automating the ForgeRock Platform
ForgeRock
 
Microservices and Amazon ECS
Microservices and Amazon ECSMicroservices and Amazon ECS
Microservices and Amazon ECS
Amazon Web Services
 

Viewers also liked (20)

A Common API & UI for Building Next Generation Identity Services
A Common API & UI for Building Next Generation Identity ServicesA Common API & UI for Building Next Generation Identity Services
A Common API & UI for Building Next Generation Identity Services
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Java application monitoring with Dropwizard Metrics and graphite
Java application monitoring with Dropwizard Metrics and graphite Java application monitoring with Dropwizard Metrics and graphite
Java application monitoring with Dropwizard Metrics and graphite
 
Upload files with grails
Upload files with grailsUpload files with grails
Upload files with grails
 
Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011Android 3.1 - Portland Code Camp 2011
Android 3.1 - Portland Code Camp 2011
 
Dropwizard at Yammer
Dropwizard at YammerDropwizard at Yammer
Dropwizard at Yammer
 
Dropwizard
DropwizardDropwizard
Dropwizard
 
Soa with consul
Soa with consulSoa with consul
Soa with consul
 
JEE on DC/OS
JEE on DC/OSJEE on DC/OS
JEE on DC/OS
 
Production Ready Web Services with Dropwizard
Production Ready Web Services with DropwizardProduction Ready Web Services with Dropwizard
Production Ready Web Services with Dropwizard
 
Groovy Tutorial
Groovy TutorialGroovy Tutorial
Groovy Tutorial
 
Metrics by coda hale : to know your app’ health
Metrics by coda hale : to know your app’ healthMetrics by coda hale : to know your app’ health
Metrics by coda hale : to know your app’ health
 
WildFly Swarm: Criando Microservices com Java EE 7
WildFly Swarm: Criando Microservices com Java EE 7WildFly Swarm: Criando Microservices com Java EE 7
WildFly Swarm: Criando Microservices com Java EE 7
 
Simple REST-APIs with Dropwizard and Swagger
Simple REST-APIs with Dropwizard and SwaggerSimple REST-APIs with Dropwizard and Swagger
Simple REST-APIs with Dropwizard and Swagger
 
Deep Dive on Microservices
Deep Dive on MicroservicesDeep Dive on Microservices
Deep Dive on Microservices
 
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
J1 2015 "Building a Microservice Ecosystem: Some Assembly Still Required"
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECS
 
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through ScriptingWebinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
Webinar: Extend The Power of The ForgeRock Identity Platform Through Scripting
 
Dev Ops Geek Fest: Automating the ForgeRock Platform
Dev Ops Geek Fest: Automating the ForgeRock PlatformDev Ops Geek Fest: Automating the ForgeRock Platform
Dev Ops Geek Fest: Automating the ForgeRock Platform
 
Microservices and Amazon ECS
Microservices and Amazon ECSMicroservices and Amazon ECS
Microservices and Amazon ECS
 

Similar to Dropwizard and Groovy

12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jruby
Joe Kutner
 
JavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor App
Joe Kutner
 
Introduction to Grails 2013
Introduction to Grails 2013Introduction to Grails 2013
Introduction to Grails 2013Gavin Hogan
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
Amazon Web Services
 
Groovy & Grails - From Scratch to Production
Groovy & Grails - From Scratch to Production Groovy & Grails - From Scratch to Production
Groovy & Grails - From Scratch to Production
Tal Maayani
 
How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015
hirokiky
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
graemerocher
 
Gradle Again
Gradle AgainGradle Again
Gradle Again
Eugen Martynov
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
Jeevesh Pandey
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
3Pillar Global
 
The Rocky Cloud Road
The Rocky Cloud RoadThe Rocky Cloud Road
The Rocky Cloud Road
Gert Drapers
 
Performance Testing using Real Browsers with JMeter & Webdriver
Performance Testing using Real Browsers with JMeter & WebdriverPerformance Testing using Real Browsers with JMeter & Webdriver
Performance Testing using Real Browsers with JMeter & Webdriver
BlazeMeter
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
Eklove Mohan
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
David M. Johnson
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
Jared Burrows
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.
Sebastian Faulhaber
 
Safe deployments with Blue-Green and Spinnaker
Safe deployments with Blue-Green and SpinnakerSafe deployments with Blue-Green and Spinnaker
Safe deployments with Blue-Green and Spinnaker
Mihnea Dobrescu-Balaur
 
12 Factor Scala
12 Factor Scala12 Factor Scala
12 Factor Scala
Joe Kutner
 
Devops
DevopsDevops
Devops
JyothirmaiG4
 

Similar to Dropwizard and Groovy (20)

12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jruby
 
JavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor AppJavaOne 2015: 12 Factor App
JavaOne 2015: 12 Factor App
 
Introduction to Grails 2013
Introduction to Grails 2013Introduction to Grails 2013
Introduction to Grails 2013
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Groovy & Grails - From Scratch to Production
Groovy & Grails - From Scratch to Production Groovy & Grails - From Scratch to Production
Groovy & Grails - From Scratch to Production
 
How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015How we realized SOA by Python at PyCon JP 2015
How we realized SOA by Python at PyCon JP 2015
 
Grails 3.0 Preview
Grails 3.0 PreviewGrails 3.0 Preview
Grails 3.0 Preview
 
Gradle Again
Gradle AgainGradle Again
Gradle Again
 
Gradle - Build System
Gradle - Build SystemGradle - Build System
Gradle - Build System
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
The Rocky Cloud Road
The Rocky Cloud RoadThe Rocky Cloud Road
The Rocky Cloud Road
 
Performance Testing using Real Browsers with JMeter & Webdriver
Performance Testing using Real Browsers with JMeter & WebdriverPerformance Testing using Real Browsers with JMeter & Webdriver
Performance Testing using Real Browsers with JMeter & Webdriver
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)Make Your Build Great Again (DroidConSF 2017)
Make Your Build Great Again (DroidConSF 2017)
 
JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.JAX 2014 - The PaaS to a better IT architecture.
JAX 2014 - The PaaS to a better IT architecture.
 
Safe deployments with Blue-Green and Spinnaker
Safe deployments with Blue-Green and SpinnakerSafe deployments with Blue-Green and Spinnaker
Safe deployments with Blue-Green and Spinnaker
 
12 Factor Scala
12 Factor Scala12 Factor Scala
12 Factor Scala
 
Devops
DevopsDevops
Devops
 

Recently uploaded

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
Abida Shariff
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 

Recently uploaded (20)

"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 

Dropwizard and Groovy

  • 1. Groovy with Dropwizard for high performance and reliable web services Tomas Lin @tomaslin
  • 2. ! Goals for this talk • Quick tour of Dropwizard functionality written with Groovy & friends instead of pure Java. • Showcase some of the “DevOps” friendly features in Dropwizard for easy setup, deployment and monitoring.
  • 3. This is not a talk about REST Services • Everything I tell you about REST will probably be a lie. • Think JSON services over http.
  • 4. REST Services REST-ful API Design - Ben Hale https://github.com/nebhale/spring-one-2013/tree/master/ rest-ful-api-design Beautiful REST + JSON APIs - Les Hazlewood http://www.slideshare.net/stormpath/rest-jsonapis
  • 5. whoami • Senior Software Engineer at Netflix • Grails developer since 2008
  • 9. Dropwizard stack • Takes mature, well known Java frameworks and glues them together. • Jetty for HTTP • Jersey for REST • Jackson for JSON • Metrics for metrics • Etc. ( Logback, Hibernate, Liquibase, etc )
  • 10. Additional Integrations • Scala • Views ( Freemaker / Mustache ) • Liquibase migrations • Authentication ( http and oAuth2 ) • Dropwizard Spring - https://github.com/ SindicatoSource/dropwizard-spring
  • 11. Who uses Dropwizard? Fraud Detection & Gift Card Services Fault Tolerant Job Scheduler https://github.com/airbnb/chronos Carl Quinn : Dropwizard + Netflix OSS tools http://tekconf.com/conferences/ codemash-2014/how-we-built-acloud-platform-at-riot-games-u
  • 12. Dropwizard + Groovy? • Bloom Health - Insurance carriers data exchange.
 Spring Batch, Dropwizard and Groovy.
 (25x faster than previous system) • Sky Find and Watch - Powers the remote record / watch now functionality • UnderwriteMe - Watch Marcin’s talk!
 http://skillsmatter.com/podcast/home/moderngroovy-enterprise-stack
  • 13. Dropwizard + Groovy? • Editorial Expansion - Time inc. subsidiary in Mexico 
 Gourmet Awards iPhone app backend.
  • 14. Why should I try Dropwizard?
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Advantages • Scale up only some parts of your application. • Isolate services based depending on their security profiles. • Fault tolerance. • Cloud friendly!
  • 24. Dropwizard with Grails at Sky Find and Watch
  • 25. Performance Dropwizard is a very high performance, low latency framework. http://www.techempower.com/benchmarks/
  • 26.
  • 27.
  • 28. Other niceties • Testable. Every part of the system can be tested during development. • Deployment friendly - easy to configure, deploy and monitor. • Pure Java.
  • 30. Lazybones Starter Template • By Kyle Boon from Bloom Health • Available via Lazybones template tool by Peter Ledbrook • You can get Lazybones via gvm
  • 31. Lazybones Starter Template • Gradle build • Spock tests • Hibernate persistance layer • Fat Jars via Shadow ( like Maven’s Shade ) • CodeNarc for clean code • Cobertura for test coverage
  • 32.
  • 33. Tasks • Test the application ./gradlew test • Build a Jar file for deploy ./gradlew shadow • Drop a database ./gradlew dropAll • Setup database ./gradlew migrate • You can add your own like deployToCloud
  • 34. Parts of a Dropwizard Application
  • 36.
  • 37. Services • Like an Application in Grails • Central place where all the other building blocks are connected.
  • 38.
  • 39.
  • 40. Services • The Dropwizard approach to services lets us see one place where all our other components are bound and glued together. • Relationships between other parts must be explicitly declared. There is no magic linking.
  • 41. Configurations • Each service has a configuration that is passed into the run method. • Dropwizard has default configurations for clients, logging and Jetty that can be overwritten
  • 42. Configurations Same jar file, configuration is externalized. ! java -jar application.jar server test.yml java -jar application.jar server stage.yml java -jar application.jar server prod.yml
  • 47. Configuration • Mapped by Jackson. Uses Hibernate Validator. • @Max / @Min • @NotNull • @Size(min=0, max=50) • @Pattern(regex=, flag=) • @Future / @Past • @NotEmpty • @CreditCardNumber
  • 50.
  • 52. Configurations • Configurations are vital because they allow us to make sure we got all the details for our service right. • One config file instead of merged conflict from many sources eliminates confusion and makes it easy to automate / swap out.
  • 53. Resources • Represent a set of service endpoints • Like Controllers in Grails • They are just Jersey Resources:
 
 https://jersey.java.net/nonav/documentation/ latest/user-guide.html#jaxrs-resources
  • 55. Resources • @GET, @POST, @PUT, @DELETE, @HEAD, @OPTIONS, and even @HttpMethod • @Path("/{user}/notifications")
 @PathParam("user") LongParam userId, @QueryParam("count") @DefaultValue("20") IntParam count
  • 57. Resources • Tested not as Unit mocks, but as Jersey components with a real Jersey server. • Similar to the FakeServer in Grails Rest Client • Dropwizard comes with a ResourceTest that works with Mockito / JUnit • I wrote a Spock equivalent available at http:// fbflex.wordpress.com/2013/01/30/dropwizardwith-spock-and-groov/
  • 58.
  • 61.
  • 62. Representations • Lets you formally describe the data flowing in and out of your REST API. • Data Transfer Objects that can be validated. • It gives you a way to easily map them into your database objects either directly or via a DAO. • Recommended approach is to share representations between servers and clients.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70. Representations • The use of representations ensure the contract between our REST endpoints and clients that consume this endpoint. • You could also just skip this and go straight to your other endpoints or JSON friendly database.
  • 72. Metrics • Uses Coda Hale’s own Metrics Library • Integrates with JMX, http, Ganglia and Graphite
  • 73. Metrics @Timed - duration and rate of events @Metered - rate of events @ExceptionMetered - rate of exceptions
  • 76. Metrics • They are first class citizens within Dropwizard. • Very flexible.You can define custom metrics, set Gauges, etc. • It’s about communicating the actual state of your server back to the mothership so it can be coordinated.
  • 77. Logging • Dropwizard has a pretty robust default logging configuration.
  • 78. Logging • We can use the @Slf4j annotation in Groovy
  • 80. Logging • I am lazy. • Don’t realize logs are needed until it is too late. • Logs are time machines to past malfunctions, making them easy to set up allows us to use them.
  • 81. Client Support • Dropwizard has available both the Apache HttpClient and the Jersey Client. • Jersey Client can use same deserialization available to the server
  • 82.
  • 83. We can now use the client within the Resource to fetch http data from other sources
  • 84. Clients • Returns a fully wrapped object that emits metrics. This allows us to monitor how they are used and identify bottlenecks or bugs.
  • 85. Managed Objects • Classes that have a start and end phase attached to the service. • Often have their own configurations. • Easy way to encapsulate integrations into other services / systems.
  • 86.
  • 87.
  • 88. Health Checks • Runtime checks that the service is operating correctly • If an exception is thrown, this is shown on the health monitoring screen • Also throws a 500 error code on the health check page for tools
  • 89.
  • 90.
  • 91.
  • 92.
  • 93. Health Checks • Quick diagnostics on running instance. • Better to kill a sick service than to keep it running and potentially corrupting your data. • Also helps when you are deploying and building out your infrastructure.
  • 94. Other Features • Tasks - Like Grails Scripts • Commands - Jobs that can be invoked via an URL. Lots of power since you’re using the same stack as your runtime service. • Others - Filters, Bundles, etc. http://www.dropwizard.io/manual/
  • 95. Deployment Make Jars, not Wars One jar file from CI to deploy
  • 96. Deploying Dropwizard java $JAVA_OPTS -Ddw.http.port=$PORT -Ddw.http.adminPort=$PORT -jar application.jar server prod.yml
  • 97. Grails Equivalents • Dropwizard Plugin by Burt Beckwith
 http://grails.org/plugin/dropwizard • Health Control Plugin by Kim Betti 
 http://grails.org/plugin/health-control • Validate Config Plugin by Andy Miller
 http://grails.org/plugin/validate-config • Metrics Plugin by Jeff Ellis
 http://grails.org/plugin/yammer-metrics
  • 98. Using Groovy • Less verbose objects. Can use map constructors. • Nice annotations for logging. • Gradle / Spock / Betamax / Lazybones. • Not sure if @CompileStatic has any changes that are significant - 6%
 [ http://kyleboon.org/blog/2013/09/26/doescompile-static-make-your-website-faster/ ]
  • 99. Development • A lot faster since there is very little magic and user interface to test. • Excellent support in IntelliJ for Gradle project and tasks.
  • 100. Final Thoughts • Think about the deployed application. • Grails + Dropwizard. Not Grails or Dropwizard. • This is just mini-scale. What happens when you have 100 services/servers? 1,000? 1,000,000? ( Come work at Netflix! )
  • 101. Thank you • Email : tomaslin@gmail.com • Twitter : @tomaslin • Slides will be posted on my blog: • http://bit.ly/tomaslin