Home

Awesome

Dropwizard Riak

Build Status Maven Central GitHub license Become a Patron

A bundle for accessing Riak in Dropwizard applications using riak-java-client.

Usage

Within your Configuration class, add the following:

@Valid
@NotNull
private final RiakFactory riak = new RiakFactory();

@JsonProperty
public RiakFactory getRiakFactory() {
    return riak;
}

Then with your Application class, you can access a RiakClient by doing the following:

@Override
public void initialize(Bootstrap<MyConfiguration> bootstrap) {
    bootstrap.addBundle(new RiakBundle<MyConfiguration>() {
        @Override
        public RiakFactory getRiakFactory(MyConfiguration configuration) {
            return configuration.getRiakFactory();
        }
    });
}

@Override
public void run(MyConfiguration configuration, Environment environment) throws Exception {
    RiakClient client = configuration.getRiakFactory().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:

<dependency>
    <groupId>com.smoketurner.dropwizard</groupId>
    <artifactId>dropwizard-riak</artifactId>
    <version>1.3.7-1</version>
</dependency>

Support

Please file bug reports and feature requests in GitHub issues.

License

Copyright (c) 2018 Smoke Turner, LLC

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

See http://www.apache.org/licenses/LICENSE-2.0.html or the LICENSE file in this repository for the full license text.