Running Dropwizard as a Guava Service » Blake Smith
There are many things to like about the Dropwizard Framework, but if you're like me, you might want to "own your main" function. A normal Dropwizard application gives you a run
hook as part of its Application
parent class, but in the end your code is still subservient to the Dropwizard framework code.
One pattern that is very good for organizing small logical services in your application is to use Guava's Services to break your application into service level groupings (And avoid the drinking the microservice kool-aid prematurely). Guava services give you a common operational interface to coordinate all your in-process logical components. In this model, the Dropwizard web server is no more important than my periodic polling service, or my separated RPC service, and so on. I'd like my Dropwizard web stack to be a peer to the other services that I'm running inside my application. It only takes two steps to make this work.
Read full article from Running Dropwizard as a Guava Service » Blake Smith
No comments:
Post a Comment