Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Dropwizard - Production Ready Web Services

James Hughes
November 06, 2013

Dropwizard - Production Ready Web Services

Dropwizard is a tool for building RESTful web services using mature and well understood libraries and technologies for the JVM. It not only provides a stack that enables rapid development of services but also actively encourages production-ready solutions with inclusion of ops focused technologies such as metrics, logging and configuration baked in.

James Hughes

November 06, 2013
Tweet

More Decks by James Hughes

Other Decks in Programming

Transcript

  1. Dropwizard is an exemplar for ops-friendly, self contained, high performing,

    framework-less web service building technologies
  2. The concepts, principles & patterns contained herein can and should

    be applied to any services you build irrespective of technology or language
  3. The rise of real service oriented architecture has meant that

    services are now an acceptable level of abstraction for defining system features
  4. Dropwizard provides a set of features that enable you to

    build systems capable of adapting to, both, a changing business and operational domain
  5. It's a little bit of opinionated glue code which bangs

    together a set of libraries which have historically not sucked github.com/dropwizard/dropwizard
  6. Guava Immutable Collections & Utils Logback Freemarker & Mustache JodaTime

    Hibernate Validator JDBI & Liquibase Logging Validation Data Access & Migration Templating Non-Terrible Time
  7. - Java is Java - Annotations are awful - Documentation

    is dispersed The “Nobody’s Perfect”
  8. 1. Create Configuration YML & Class 2. Create the Service

    3. Create the Representation 4. Create & Register the Resource 5. Build & Run Lets Build a Service!!!
  9. I could have done this with Rails, Sinatra, Spring, Play,

    Finagle, Express, Nancy.… So What?
  10. class DBManager implements Managed { public void start() { …

    } public void stop() { … } } // register in Service.initialize() environment.manage(myDBManager) Managed Objects
  11. Commands // register in Service.initalize() bootstrap.addCommand(myCommand) > java -jar app.jar

    dingus class DingusCommand implements Command { public void configure(parser) { … } public void run(bootstrap, ns) { … } }
  12. Tasks // register in Service.run() environment.addTask(myTask) > curl -X POST

    http://server/tasks/dingus class DingusTask implements Task { public void execute(params, out) { … } }