SlideShare une entreprise Scribd logo
1  sur  22
Télécharger pour lire hors ligne
Dropwizard & Spring
The perfect Java REST stack

Jacek Furmankiewicz
Architect @ PROS, Inc.
1
Welcome to Houston TechFest
Thank you for being a part of the
7th Annual Houston TechFest!
Please turn off all electronic devices or set them to vibrate.
If you must take a phone call, please do so in the lobby so
as not to disturb others.
Thanks to our Diamond Sponsors:

2
Information
Speaker presentation slides will be available at www.houstontechfest.org within a
week
Don’t forget to complete the Bingo card to be eligible for door prizes

3
4
Dropwizard

Dropwizard

What is it and why is it so exciting?

4
Dropwizard

Created by Coda Hale @ Yammer
http://dropwizard.io

5
Dropwizard

Best-of-breed Java libraries integrated into one
embedded application package
●

Embedded Jetty (no WAR, no external servlet container)

●

JAX-RS (Jersey) for REST APIs

●

JSON (Jackson)

●

Logging (Logback and SLF4J)

●

Hibernate Validators

●

Metrics (application SLA and performance)

6
Dropwizard

Embedded Jetty
●

Restart your code in seconds. Run your code from the IDE.

●

No WAR to recompile (ever!)

●

No WAR to redeploy (ever!)

●

No servlet container (Tomcat, Websphere, Weblogic, etc) to install

●

●

●

Debug from your IDE (you have a main()), no need to attach to a separate
process
No need to share heap and GC issues with other apps running in the same
servlet container
Total process isolation (one misbehaving WAR (e.g. OutOfMemoryException)
cannot bring down the entire server process)

7
Dropwizard

Anatomy of a Dropwizard application

Jetty

Jersey

YOUR CODE
(business logic, DAO,
Spring, JPA, etc.)

8
Dropwizard

Multiple apps on the same server
pid 1843
Jetty

Jersey

APP 1

Own JVM
4 GB heap

Jersey

APP 2

Own JVM
4 GB heap

Jersey

APP 3

Own JVM
4 GB heap

pid 1407
Jetty
pid 1976
Jetty

9
Dropwizard

Operations-friendly and ready for deployment
●

Opens 2 HTTP ports: one for public APIs (i.e. your REST services), one for
admin APIs (e.g. run GC, refresh internal caches, etc)

●

Admin port can be closed off on the firewall and inaccessible to outside world

●

Health Check APIs to allow easy monitoring from external tools like Nagios

●

@Timed annotation on any single REST API allows to track its SLA using Metrics
library

10
Dropwizard

Ease of deployment
●

●

Dropwizard apps can be easily compiled into a single JAR with all dependencies
(e.g. using Maven Shade or Gradle Shadow plugins)
Your entire app consists of two files:
YAML config file
JAR application file

●

Trivial to run from command line:
java -server myapp.jar server myapp.yml

11
Dropwizard

Ease of deployment – part 2
●

Can be wrapped in an RPM or DEB to install on Linux clusters

●

Can be registered as a Linux daemon, e.g.
sudo start myapp
sudo stop myapp

12
Dropwizard

Embedding HTML resources
●

●

●

Dropwizard provides the concept of AssetBundle, which allows to bundle
HTML/JS/CSS assets directly in the app (via your src/main/resources folder)
Perfect for creating a modern HTML5 Javascript UI (Backbone.js, Ember.js,
Angular.js, etc) powered by rock-solid super fast Java REST APIs – the best of
both worlds
In 2013, you should not be using any Java (or .Net or Python or Ruby) serverside web frameworks.
HTML5 and Javascript have won and are the future of web development.
Java is best at providing REST APIs to power them with top reliability and
performance.

13
Dropwizard and Spring

Dropwizard and Spring DI
Adding dependency injection

14
Dropwizard and Spring

Integrating Spring DI
●

●

●

●

Start up parent Spring context (AnnotationConfigWebApplicationContext)
Inject Dropwizard Configuration object into it (so that it is available as a Spring
bean)
Start a child context (with the parent in it), also of type
AnnotationConfigWebApplicationContext
Extract all the Spring beans that Dropwizard cares about from the context and
register them within Dropwizard:
–
–

●

JAX-RS @Path resources and @Provider classes
Dropwizard Task and HealthCheck objects

Link Spring with the embedded Jetty instance, so that it behaves just as if it were
running in a regular servlet container

15
Dropwizard and Spring

Integrating Spring DI – part 2
Sample app with a full example:
https://github.com/jacek99/dropwizard-spring-di-security-onejar-example

In particular this class has all the low-level details:
MyAppService.java

16
Dropwizard and Spring

Dropwizard and Spring
Security
Adding enterprise-grade security

17
Dropwizard and Spring Security
●

@ImportResource Spring Security XML config file into your root Spring
@Configuration class

●

Activate Spring Security filter

●

Provides both HTTP and method level (@Secured) support

●

Present in github sample app covered previously

18
Dropwizard

Dropwizard
user comments
Words from people who use it
every day
19
Dropwizard
●

●

Dropwizard is a godsend for all those of us who just need to get stuff DONE.
Dropwizard changed the rules of the game completely. We have dramatically
changed the way of working and increased the speed of whole development
process. Dropwizard is being considered as a Restful Application Framework but
this is totally unfair and limiting its potential. We have just added a few classes
without forking it to operate Spring Framework and it is working wonderfully. That
is to say, Dropwizard can be also considered as a "embedded application
development framework" and we are using in this way

20
Dropwizard

Q&A
PROS
Interested in Big Data and real-time
challenges?
We're hiring!
http://www.pros.com/company/working-pros/

21
Please Leave Feedback During Q&A
If you leave
session feedback
and provide
contact
information, you
will be qualified for
a prize
Scan the QR code
to the right or go
to bit.ly/htf130514
22

Contenu connexe

Tendances

Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 
The Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeThe Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeVMware Tanzu
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page AppsZachary Klein
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internalscarlo-rtr
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with javaDPC Consulting Ltd
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureZachary Klein
 
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
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSAOracle Korea
 
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019Matt Raible
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinLeanIX GmbH
 
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
 
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 JaFuVMware Tanzu
 
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 ProjectsGR8Conf
 

Tendances (20)

Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 
Microservices/dropwizard
Microservices/dropwizardMicroservices/dropwizard
Microservices/dropwizard
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
The Past Year in Spring for Apache Geode
The Past Year in Spring for Apache GeodeThe Past Year in Spring for Apache Geode
The Past Year in Spring for Apache Geode
 
Micronaut For Single Page Apps
Micronaut For Single Page AppsMicronaut For Single Page Apps
Micronaut For Single Page Apps
 
Dropwizard Internals
Dropwizard InternalsDropwizard Internals
Dropwizard Internals
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with java
 
Micronaut: Changing the Micro Future
Micronaut: Changing the Micro FutureMicronaut: Changing the Micro Future
Micronaut: Changing the Micro Future
 
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...
 
Javantura v4 - (Spring)Boot your application on Red Hat middleware stack - Al...
Javantura v4 - (Spring)Boot your application on Red Hat middleware stack - Al...Javantura v4 - (Spring)Boot your application on Red Hat middleware stack - Al...
Javantura v4 - (Spring)Boot your application on Red Hat middleware stack - Al...
 
SpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSASpringBoot and Spring Cloud Service for MSA
SpringBoot and Spring Cloud Service for MSA
 
Lagom in Practice
Lagom in PracticeLagom in Practice
Lagom in Practice
 
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
Java Microservices with Spring Boot and Spring Cloud - Denver JUG 2019
 
GR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug inGR8Conf 2011: Grails, how to plug in
GR8Conf 2011: Grails, how to plug in
 
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp BerlinTech Talk: DevOps at LeanIX @ Startup Camp Berlin
Tech Talk: DevOps at LeanIX @ Startup Camp Berlin
 
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
 
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
 
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
 
Apache Lucene for Java EE Developers
Apache Lucene for Java EE DevelopersApache Lucene for Java EE Developers
Apache Lucene for Java EE Developers
 

En vedette

Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Nenad Pecanac
 
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
 
Production Ready Web Services with Dropwizard
Production Ready Web Services with DropwizardProduction Ready Web Services with Dropwizard
Production Ready Web Services with Dropwizardsullis
 
"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture
"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture
"Don't call us, we'll call you" - AngularJS meets Event-Driven ArchitectureLuca Milan
 
JEST: REST on OpenJPA
JEST: REST on OpenJPAJEST: REST on OpenJPA
JEST: REST on OpenJPAPinaki Poddar
 
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 7George Gastaldi
 
Dropwizard at Yammer
Dropwizard at YammerDropwizard at Yammer
Dropwizard at YammerJamie Furness
 
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 ECSAmazon Web Services
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudConor Svensson
 
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...Tokuhiro Matsuno
 
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entitySpring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entityToni Jara
 
Building REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring CloudBuilding REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring CloudKenny Bastani
 
Use of computer software in airline
Use of computer software in airlineUse of computer software in airline
Use of computer software in airlinesaurav rawat
 

En vedette (20)

Dropwizard
DropwizardDropwizard
Dropwizard
 
Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015Microservice Architecture JavaCro 2015
Microservice Architecture JavaCro 2015
 
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
 
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
 
"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture
"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture
"Don't call us, we'll call you" - AngularJS meets Event-Driven Architecture
 
JEST: REST on OpenJPA
JEST: REST on OpenJPAJEST: REST on OpenJPA
JEST: REST on OpenJPA
 
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
 
Dropwizard at Yammer
Dropwizard at YammerDropwizard at Yammer
Dropwizard at Yammer
 
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
 
Microservices and Amazon ECS
Microservices and Amazon ECSMicroservices and Amazon ECS
Microservices and Amazon ECS
 
Just enough app server
Just enough app serverJust enough app server
Just enough app server
 
Cloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring CloudCloud Native Microservices with Spring Cloud
Cloud Native Microservices with Spring Cloud
 
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
promgen - prometheus managemnet tool / simpleclient_java hacks @ Prometheus c...
 
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entitySpring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
 
Building REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring CloudBuilding REST APIs with Spring Boot and Spring Cloud
Building REST APIs with Spring Boot and Spring Cloud
 
Use of computer software in airline
Use of computer software in airlineUse of computer software in airline
Use of computer software in airline
 

Similaire à Dropwizard Spring - the perfect Java REST server stack

Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2JooinK
 
Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel HackingDeveler S.r.l.
 
Ext GWT - Overview and Implementation Case Study
Ext GWT - Overview and Implementation Case StudyExt GWT - Overview and Implementation Case Study
Ext GWT - Overview and Implementation Case StudyAvi Perez
 
How to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentHow to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentMichelantonio Trizio
 
Aug penguin16
Aug penguin16Aug penguin16
Aug penguin16alhino
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13Fred Sauer
 
My tools for sfdc developer
My tools for sfdc developerMy tools for sfdc developer
My tools for sfdc developerEXIAHUANG
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersJavan Rasokat
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Priyanka Tyagi
 
Spring Roo Flex Add-on
Spring Roo Flex Add-onSpring Roo Flex Add-on
Spring Roo Flex Add-onBill Ott
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introductionvstorm83
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-pythonDeepak Garg
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Priyanka Tyagi
 
Introduction Flutter for Create Multiplatform Apps
Introduction Flutter for Create Multiplatform AppsIntroduction Flutter for Create Multiplatform Apps
Introduction Flutter for Create Multiplatform AppsYatno Sudar
 
An introduction to Node.js application development
An introduction to Node.js application developmentAn introduction to Node.js application development
An introduction to Node.js application developmentshelloidhq
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfAdityamd4
 

Similaire à Dropwizard Spring - the perfect Java REST server stack (20)

Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2Javascript as a target language - GWT KickOff - Part 2/2
Javascript as a target language - GWT KickOff - Part 2/2
 
Workshop su Android Kernel Hacking
Workshop su Android Kernel HackingWorkshop su Android Kernel Hacking
Workshop su Android Kernel Hacking
 
Ext GWT - Overview and Implementation Case Study
Ext GWT - Overview and Implementation Case StudyExt GWT - Overview and Implementation Case Study
Ext GWT - Overview and Implementation Case Study
 
How to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environmentHow to deploy a Java application on Google App engine Flexible environment
How to deploy a Java application on Google App engine Flexible environment
 
Aug penguin16
Aug penguin16Aug penguin16
Aug penguin16
 
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
SF JUG - GWT Can Help You Create Amazing Apps - 2009-10-13
 
My tools for sfdc developer
My tools for sfdc developerMy tools for sfdc developer
My tools for sfdc developer
 
Android session-1-sajib
Android session-1-sajibAndroid session-1-sajib
Android session-1-sajib
 
Android Attacks
Android AttacksAndroid Attacks
Android Attacks
 
Visage fx
Visage fxVisage fx
Visage fx
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)
 
Spring Roo Flex Add-on
Spring Roo Flex Add-onSpring Roo Flex Add-on
Spring Roo Flex Add-on
 
eXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework IntroductioneXo Platform SEA - Play Framework Introduction
eXo Platform SEA - Play Framework Introduction
 
Google app-engine-with-python
Google app-engine-with-pythonGoogle app-engine-with-python
Google app-engine-with-python
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)
 
Introduction Flutter for Create Multiplatform Apps
Introduction Flutter for Create Multiplatform AppsIntroduction Flutter for Create Multiplatform Apps
Introduction Flutter for Create Multiplatform Apps
 
Introduction to Frida
Introduction to FridaIntroduction to Frida
Introduction to Frida
 
An introduction to Node.js application development
An introduction to Node.js application developmentAn introduction to Node.js application development
An introduction to Node.js application development
 
MOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdfMOBILE PENTESTING Frida.pdf
MOBILE PENTESTING Frida.pdf
 

Dernier

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Dernier (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 

Dropwizard Spring - the perfect Java REST server stack

  • 1. Dropwizard & Spring The perfect Java REST stack Jacek Furmankiewicz Architect @ PROS, Inc. 1
  • 2. Welcome to Houston TechFest Thank you for being a part of the 7th Annual Houston TechFest! Please turn off all electronic devices or set them to vibrate. If you must take a phone call, please do so in the lobby so as not to disturb others. Thanks to our Diamond Sponsors: 2
  • 3. Information Speaker presentation slides will be available at www.houstontechfest.org within a week Don’t forget to complete the Bingo card to be eligible for door prizes 3
  • 4. 4 Dropwizard Dropwizard What is it and why is it so exciting? 4
  • 5. Dropwizard Created by Coda Hale @ Yammer http://dropwizard.io 5
  • 6. Dropwizard Best-of-breed Java libraries integrated into one embedded application package ● Embedded Jetty (no WAR, no external servlet container) ● JAX-RS (Jersey) for REST APIs ● JSON (Jackson) ● Logging (Logback and SLF4J) ● Hibernate Validators ● Metrics (application SLA and performance) 6
  • 7. Dropwizard Embedded Jetty ● Restart your code in seconds. Run your code from the IDE. ● No WAR to recompile (ever!) ● No WAR to redeploy (ever!) ● No servlet container (Tomcat, Websphere, Weblogic, etc) to install ● ● ● Debug from your IDE (you have a main()), no need to attach to a separate process No need to share heap and GC issues with other apps running in the same servlet container Total process isolation (one misbehaving WAR (e.g. OutOfMemoryException) cannot bring down the entire server process) 7
  • 8. Dropwizard Anatomy of a Dropwizard application Jetty Jersey YOUR CODE (business logic, DAO, Spring, JPA, etc.) 8
  • 9. Dropwizard Multiple apps on the same server pid 1843 Jetty Jersey APP 1 Own JVM 4 GB heap Jersey APP 2 Own JVM 4 GB heap Jersey APP 3 Own JVM 4 GB heap pid 1407 Jetty pid 1976 Jetty 9
  • 10. Dropwizard Operations-friendly and ready for deployment ● Opens 2 HTTP ports: one for public APIs (i.e. your REST services), one for admin APIs (e.g. run GC, refresh internal caches, etc) ● Admin port can be closed off on the firewall and inaccessible to outside world ● Health Check APIs to allow easy monitoring from external tools like Nagios ● @Timed annotation on any single REST API allows to track its SLA using Metrics library 10
  • 11. Dropwizard Ease of deployment ● ● Dropwizard apps can be easily compiled into a single JAR with all dependencies (e.g. using Maven Shade or Gradle Shadow plugins) Your entire app consists of two files: YAML config file JAR application file ● Trivial to run from command line: java -server myapp.jar server myapp.yml 11
  • 12. Dropwizard Ease of deployment – part 2 ● Can be wrapped in an RPM or DEB to install on Linux clusters ● Can be registered as a Linux daemon, e.g. sudo start myapp sudo stop myapp 12
  • 13. Dropwizard Embedding HTML resources ● ● ● Dropwizard provides the concept of AssetBundle, which allows to bundle HTML/JS/CSS assets directly in the app (via your src/main/resources folder) Perfect for creating a modern HTML5 Javascript UI (Backbone.js, Ember.js, Angular.js, etc) powered by rock-solid super fast Java REST APIs – the best of both worlds In 2013, you should not be using any Java (or .Net or Python or Ruby) serverside web frameworks. HTML5 and Javascript have won and are the future of web development. Java is best at providing REST APIs to power them with top reliability and performance. 13
  • 14. Dropwizard and Spring Dropwizard and Spring DI Adding dependency injection 14
  • 15. Dropwizard and Spring Integrating Spring DI ● ● ● ● Start up parent Spring context (AnnotationConfigWebApplicationContext) Inject Dropwizard Configuration object into it (so that it is available as a Spring bean) Start a child context (with the parent in it), also of type AnnotationConfigWebApplicationContext Extract all the Spring beans that Dropwizard cares about from the context and register them within Dropwizard: – – ● JAX-RS @Path resources and @Provider classes Dropwizard Task and HealthCheck objects Link Spring with the embedded Jetty instance, so that it behaves just as if it were running in a regular servlet container 15
  • 16. Dropwizard and Spring Integrating Spring DI – part 2 Sample app with a full example: https://github.com/jacek99/dropwizard-spring-di-security-onejar-example In particular this class has all the low-level details: MyAppService.java 16
  • 17. Dropwizard and Spring Dropwizard and Spring Security Adding enterprise-grade security 17
  • 18. Dropwizard and Spring Security ● @ImportResource Spring Security XML config file into your root Spring @Configuration class ● Activate Spring Security filter ● Provides both HTTP and method level (@Secured) support ● Present in github sample app covered previously 18
  • 19. Dropwizard Dropwizard user comments Words from people who use it every day 19
  • 20. Dropwizard ● ● Dropwizard is a godsend for all those of us who just need to get stuff DONE. Dropwizard changed the rules of the game completely. We have dramatically changed the way of working and increased the speed of whole development process. Dropwizard is being considered as a Restful Application Framework but this is totally unfair and limiting its potential. We have just added a few classes without forking it to operate Spring Framework and it is working wonderfully. That is to say, Dropwizard can be also considered as a "embedded application development framework" and we are using in this way 20
  • 21. Dropwizard Q&A PROS Interested in Big Data and real-time challenges? We're hiring! http://www.pros.com/company/working-pros/ 21
  • 22. Please Leave Feedback During Q&A If you leave session feedback and provide contact information, you will be qualified for a prize Scan the QR code to the right or go to bit.ly/htf130514 22