Dropwizard TinkerPop

A Dropwizard library to connect to Apache TinkerPop enabled graph servers

License

License

Categories

Categories

DropWizard Container Microservices
GroupId

GroupId

com.experoinc
ArtifactId

ArtifactId

dropwizard-tinkerpop
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Dropwizard TinkerPop
A Dropwizard library to connect to Apache TinkerPop enabled graph servers
Project URL

Project URL

https://github.com/experoinc/dropwizard-tinkerpop
Source Code Management

Source Code Management

https://github.com/experoinc/dropwizard-tinkerpop

Download dropwizard-tinkerpop

How to add to project

<!-- https://jarcasting.com/artifacts/com.experoinc/dropwizard-tinkerpop/ -->
<dependency>
    <groupId>com.experoinc</groupId>
    <artifactId>dropwizard-tinkerpop</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.experoinc/dropwizard-tinkerpop/
implementation 'com.experoinc:dropwizard-tinkerpop:1.0.1'
// https://jarcasting.com/artifacts/com.experoinc/dropwizard-tinkerpop/
implementation ("com.experoinc:dropwizard-tinkerpop:1.0.1")
'com.experoinc:dropwizard-tinkerpop:jar:1.0.1'
<dependency org="com.experoinc" name="dropwizard-tinkerpop" rev="1.0.1">
  <artifact name="dropwizard-tinkerpop" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.experoinc', module='dropwizard-tinkerpop', version='1.0.1')
)
libraryDependencies += "com.experoinc" % "dropwizard-tinkerpop" % "1.0.1"
[com.experoinc/dropwizard-tinkerpop "1.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.tinkerpop : gremlin-driver jar 3.2.6
io.dropwizard : dropwizard-core jar 1.0.0
org.slf4j : slf4j-api jar 1.7.25

test (2)

Group / Artifact Type Version
io.dropwizard : dropwizard-testing jar 1.0.0
org.apache.tinkerpop : tinkergraph-gremlin jar 3.2.6

Project Modules

There are no modules declared in this project.

dropwizard-tinkerpop

Build Status

A Dropwizard library that enables connectivity to Apache TinkerPop enabled gremlin servers.

See this blog post for a simple getting started guide.

Components

  • Configuration
  • Health Check
  • Managed Cluster

Configuration

The configuration class includes all of the parameters required to configure a remote connection to a TinkerPop server. The default values correspond to all of the defaults specified in the TinkerPop cluster builder.

Health Check

A health check is setup using the dropwizard health check registry. It executes the validationQuery specified in the configuration. It will succeed if the query responds within the validationQueryTimeout specified.

Managed Connection

The Cluster built from the TinkerPopFactory is included in dropwizard's managed lifecycle. This will allow dropwizard to try and gracefully shut down the TinkerPop client connections on shutdown.

Usage

Include the dropwizard-tinkerpop library as a dependency

<dependency>
  <groupId>com.experoinc</groupId>
  <artifactId>dropwizard-tinkerpop</artifactId>
  <version>${dropwizard-tinkerpop.version}</version>
</dependency>

Include a TinkerPopFactory instance in your application config

public class AppConfig extends Configuration {

    @Valid
    @NotNull
    private TinkerPopFactory tinkerPopFactory = new TinkerPopFactory();

    @JsonProperty("tinkerPop")
    public TinkerPopFactory getTinkerPopFactory() {
        return tinkerPopFactory;
    }

    @JsonProperty("tinkerPop")
    public void setTinkerPopFactory(TinkerPopFactory tinkerPopFactory) {
        this.tinkerPopFactory = tinkerPopFactory;
    }
}

Build the TinkerPop cluster in your applications run(AppConfig ac, Environment environment) method.

public class App extends Application<AppConfig> {
    
    @Override
    public void run(AppConfig configuration, Environment environment) throws Exception {
        Cluster cluster = configuration.getTinkerPopFactory().build(environment);
    }
}

Testing

Docker Compose is required for testing. Running docker-compose up -d will start two Gremlin server containers, one for SSL and one for non-SSL testing. You can run docker-compose down to stop and remove the containers. Tests are run by running mvn clean install.

com.experoinc

Versions

Version
1.0.1
1.0.0