Production Ready Web Services with Dropwizard
Upcoming SlideShare
Loading in...5

Production Ready Web Services with Dropwizard



Portland Java User Group

Portland Java User Group
May 15, 2012



Total Views
Views on SlideShare
Embed Views



3 Embeds 145 75 69 1



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

Production Ready Web Services with Dropwizard Production Ready Web Services with Dropwizard Presentation Transcript

  • Production Ready WebServices with Dropwizard Portland Java User Group May 15, 2012 Sean Sullivan
  • • Gilt Groupe• Dropwizard project• Dropwizard at Gilt
  • Gilt Groupe
  • online retailer
  • May 2011
  • April 2012
  • What does Gilt sell?
  • Apparel
  • Kids toys and apparel
  • Home furnishings
  • Food
  • Local deals
  • Travel
  • Gilt technology
  • Portland NYC Dublin
  • Service oriented architecture
  • email serviceproduct serviceshopping cart servicecheckout servicepayment service
  • internal “service framework” image credit:
  • Dropwizard
  • “Dropwizard consists mostly of glue codeto automatically connect and configurethese components”• Jetty • logback• Jersey • Yammer Metrics• Jackson • Google Guava• JDBI • Hibernate Validator
  • Dropwizard modules• dropwizard-core • dropwizard-scala• dropwizard-client • dropwizard-views• dropwizard-db • dropwizard-testing• dropwizard-auth
  • <dependencies> <dependency> <groupId>com.yammer.dropwizard</groupId> <artifactId>dropwizard-core</artifactId> <version>0.4.0</version> </dependency> <dependency> <groupId>com.yammer.dropwizard</groupId> <artifactId>dropwizard-scala</artifactId> <version>0.4.0</version> </dependency></dependencies> Maven pom.xml
  • + Java services extendcom.yammer.dropwizard.Service
  • + Scala services extendcom.yammer.dropwizard.ScalaService
  • Service configuration
  • YAML + config class
  • import com.yammer.dropwizard.config.Configuration;public class MyServiceConfiguration extends Configuration { // your config stuff}
  • Other config• com.yammer.dropwizard.config.HttpConfiguration• com.yammer.dropwizard.config.LoggingConfiguration• com.yammer.dropwizard.db.DatabaseConfiguration
  • Hello world
  • Compile and run$ git clone git://$ cd dropwizard-helloworld$ mvn clean package$ ./bin/
  • http://localhost:8080/helloworld?name=Portland
  • Dropwizard at Gilt
  • gift certificate servicefraud service
  • Gift certificate demo
  • dropwizard-gilt• Jackson ObjectMapper configuration• Log4j appender config• ZooKeeper registration• MessagingManager class
  • Hibernate Validator + Scala case classes
  • SOA challenges• deployment• QA• monitoring• debugging
  • Questions?
  • Bonus slides
  • “Monitoring and QA are the same thing.Youd never think so untilyou try doing a big SOA. But when your service says "oh yes, Imfine", it may well be the case that the only thing still functioning inthe server is the little component that knows how to say "Imfine, roger roger, over and out" in a cheery droid voice. In order totell whether the service is actually responding, you have to makeindividual calls.The problem continues recursively until yourmonitoring is doing comprehensive semantics checking of yourentire range of services and data, at which point itsindistinguishable from automated QA” Steve Yegge, October 2011
  • “If you have hundreds of services, and your code MUSTcommunicate with other groups code via these services, thenyou wont be able to find any of them without a service-discovery mechanism. And you cant have that without aservice registration mechanism, which itself is another service.So Amazon has a universal service registry where you can findout reflectively (programmatically) about every service, whatits APIs are, and also whether it is currently up, and where” Steve Yegge, October 2011