Turbo charge your Dropwizard 0.8.X Microservice using this lazybones template, inspired by KyleBoon's Lazybones Template for Dropwizard 0.7.0
For more instructions on lazybones( Project Creation tool) and how to build this project refer to: Lazy Bones and Template developer guide
There are many Dropwizard Modules available to extend from. However sometimes it may be difficult for all modules to play well together. This templates aims to pull together various essential modules we came across in our day to day projects and present them as a stable integrated bundle together with unit/integration tests.
The resultant project is tailored towards the following usages (see Tech Stack below for more details):
- dependency injection - use Guice auto config to avoid boilerplate code.
- containerised deployment - Docker or Heroku containers: single port and ENV variables available during runtime only
- continuous delivery - application version is not hardcoded but passed in at build time via gradle property:
-Papp_version
- Java8 - lambdas, Optional and LocalDate.
The result project will also mark certain modules and dependencies as optional, they can be deleted based on your needs.
Install lazybones using gvm
gvm install lazybones
Update lazybones config to point to trunkplatform lazybones repository:
mkdir ~/.lazybones
lazybones config set bintrayRepositories "pledbrook/lazybones-templates", "trunkplatform/lazybones"
To list available template versions use:
lazybones info dropwizard-turbo
Make sure you are using lazybones 0.8+
lazybones create dropwizard-turbo {version} destination
Make sure you set your IDE to Java1.8 when importing this project.
If you wish to build from source or make contributions to this project:
gradle packageTemplateDropwizardTurbo
gradle installAllTemplates
That will create the template and install it to your local lazybones cache. After that you can use the template as you would normally.
Most of the following dependencies are optional. Mix and match as you see fit.
- Dropwizard Hibernate - database ORM
- Dropwizard Migrations - liquibase migration. Also see
gradle/migrations.gradle
- Dropwizard Jersey Client - to connect with other REST API endpoints.
- Dropwizard Java8
- Dropwizard Java8 Authentication
- Dropwizard Guice - DI and auto configures resources, healthcheck, tasks, managed, jersey providers.
- Governator - lazy singleton and life cycle management.
- Dropwizard Template Configuration - swaps in environment variables using freemarker templating.
- Swagger - interactive documentation
- Pact Gradle - consumer driven contract testing using Pact. See
gradle/pact.gradle
- NewRelic - for monitoring. See
gradle/newrelic.gradle
- Docker - Includes sample Dockerfile.
- Dropwizard Testing - sample Resource and Integration tests provided
- Shadow - building exectutable fatjar. See
gradle/shadow.gradle
- CORS Filter - CORS implementation using Jersey
ContainerResponseFilter