Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.


Repository files navigation

Dropwizard Atomix

Build Status Maven Central GitHub license Become a Patron

A bundle for integrating Atomix in Dropwizard applications.


Within your Configuration class, add the following:

private final AtomixFactory atomix = new AtomixFactory();

public AtomixFactory getAtomixFactory() {
    return atomix;

Then with your Application class, you can access an Atomix by doing the following:

public void initialize(Bootstrap<MyConfiguration> bootstrap) {
    bootstrap.addBundle(new AtomixBundle<MyConfiguration>() {
        public AtomixFactory getAtomixFactory(MyConfiguration configuration) {
            return configuration.getAtomixFactory();

public void run(MyConfiguration configuration, Environment environment) throws Exception {
    Atomix atomix = configuration.getAtomixFactory().build();

Maven Artifacts

This project is available on Maven Central. To add it to your project simply add the following dependencies to your pom.xml:


Example Application

To try the example application, checkout the code from Github then build the example hello world application.

git clone
cd dropwizard-atomix
./mvnw compile package
cd atomix-example

You then need to open 3 separate terminal windows to launch 3 instances of the application:

java -jar target/atomix-example-1.3.7-2-SNAPSHOT.jar server config1.yml
java -jar target/atomix-example-1.3.7-2-SNAPSHOT.jar server config2.yml
java -jar target/atomix-example-1.3.7-2-SNAPSHOT.jar server config3.yml

Once a quorum has been reached, Jetty will start up as normal on a random port which you'll be able to see in the logs.

INFO  [2018-01-07 15:29:43,489] org.eclipse.jetty.server.handler.ContextHandler: Started i.d.j.MutableServletContextHandler@2ad99cf3{/admin,null,AVAILABLE}
INFO  [2018-01-07 15:29:43,494] org.eclipse.jetty.server.AbstractConnector: Started hello-world@554f0dfb{HTTP/1.1,[http/1.1]}{}
INFO  [2018-01-07 15:29:43,494] org.eclipse.jetty.server.Server: Started @13775ms

You can then visit http://localhost:55419/hello-world to see the Dropwizard Getting Started example, but using a distributed counter across the cluster.


Please file bug reports and feature requests in GitHub issues.


Copyright (c) 2018 Smoke Turner, LLC

This library is licensed under the Apache License, Version 2.0.

See or the LICENSE file in this repository for the full license text.