Using Jetty inside of one’s app

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com, or follow me on Twitter.

This is exactly what I want to do with the chat app I’m writing: embed Jetty so I won’t have all the complications of dealing with an external service:

Jetty for HTTP

Because you can’t be a web service without HTTP, Dropwizard uses the Jetty HTTP library to embed an incredibly tuned HTTP server directly into your project. Instead of handing your service off to a complicated application server, Dropwizard projects have a main method which spins up an HTTP server. Running your service as a simple process eliminates a number of unsavory aspects of Java in production (no PermGem issues, no application server configuration and maintenance, no arcane deployment tools, no ClassLoader troubles, no hidden application logs, no trying to tune a single garbage collector to work with multiple application workloads) and allows you to use all of the existing Unix process management tools instead.

Post external references

  1. 1
    http://dropwizard.codahale.com/getting-started/
Source