Production Ready Web Services with Dropwizard

  • 8,986 views
Uploaded on

Portland Java User Group …

Portland Java User Group
May 15, 2012

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
8,986
On Slideshare
0
From Embeds
0
Number of Embeds
3

Actions

Shares
Downloads
99
Comments
0
Likes
11

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Production Ready WebServices with Dropwizard Portland Java User Group May 15, 2012 Sean Sullivan
  • 2. http://twitter.com/hipsterhacker/status/193559234259075074
  • 3. • Gilt Groupe• Dropwizard project• Dropwizard at Gilt
  • 4. Gilt Groupe
  • 5. online retailer
  • 6. May 2011
  • 7. April 2012
  • 8. What does Gilt sell?
  • 9. Apparel
  • 10. Kids toys and apparel
  • 11. Home furnishings
  • 12. Food
  • 13. Local deals
  • 14. Travel
  • 15. Gilt technology
  • 16. Portland NYC Dublin
  • 17. Service oriented architecture
  • 18. email serviceproduct serviceshopping cart servicecheckout servicepayment service
  • 19. internal “service framework” image credit: dealwithitportland.com
  • 20. Dropwizard
  • 21. “Dropwizard consists mostly of glue codeto automatically connect and configurethese components”• Jetty • logback• Jersey • Yammer Metrics• Jackson • Google Guava• JDBI • Hibernate Validator
  • 22. Dropwizard modules• dropwizard-core • dropwizard-scala• dropwizard-client • dropwizard-views• dropwizard-db • dropwizard-testing• dropwizard-auth
  • 23. <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
  • 24. + Java services extendcom.yammer.dropwizard.Service
  • 25. + Scala services extendcom.yammer.dropwizard.ScalaService
  • 26. Service configuration
  • 27. YAML + config class
  • 28. import com.yammer.dropwizard.config.Configuration;public class MyServiceConfiguration extends Configuration { // your config stuff}
  • 29. Other config• com.yammer.dropwizard.config.HttpConfiguration• com.yammer.dropwizard.config.LoggingConfiguration• com.yammer.dropwizard.db.DatabaseConfiguration
  • 30. Hello world
  • 31. Compile and run$ git clone git://github.com/sullis/dropwizard-helloworld.git$ cd dropwizard-helloworld$ mvn clean package$ ./bin/dev.sh
  • 32. http://localhost:8080/helloworld?name=Portland
  • 33. Dropwizard at Gilt
  • 34. gift certificate servicefraud service
  • 35. Gift certificate demo
  • 36. dropwizard-gilt• Jackson ObjectMapper configuration• Log4j appender config• ZooKeeper registration• MessagingManager class
  • 37. Hibernate Validator + Scala case classes https://groups.google.com/d/topic/dropwizard-user/sGEi3i8W1tY/discussion
  • 38. https://twitter.com/#!/cowtowncoder/status/198167133887266816
  • 39. SOA challenges• deployment• QA• monitoring• debugging
  • 40. Questions?
  • 41. THE END
  • 42. Bonus slides
  • 43. “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 http://bit.ly/pityk6
  • 44. “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 http://bit.ly/pityk6