Skip to content

A set of classes to use a gRPC server in a Dropwizard service.

License

Notifications You must be signed in to change notification settings

DrMattFaulkner/dropwizard-grpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dropwizard gRPC

Build Status Coverage Status Maven Central

A set of classes to use [gRPC] 1 server in a [Dropwizard] 2 application

The package provides [lifecycle-management] 3 and configuration factory classes with the most common options for gRPC Server and ManagedChannel classes.

Server

Usage

To embed a grpc server, add a GrpcServerFactory to your Configuration class. This enables configuration of the grpc server port and transport security files.

Use the GrpcServerFactory class to create a ServerBuilder via builder(). Next, add services with addService(). Finally, build() the Server. It is automatically added to the dropwizard lifecycle.

TODO Example

Configuration

The following configuration settings are supported by GrpcServerFactory:

  • port: Port number the gRPC server should bind on
  • shutdownDuration: How long to wait before giving up when the server is shutdown
  • certChainFile: Path to the certificate chain file when TLS should be used
  • privateKeyFile: Path to the private key file when TLS should be used

TODO Example

Client

Usage

To embed a grpc channel for a server, add a GrpcChannelFactory to your Configuration class. This enables configuration of the grpc channel hostname and port. The GrpcChannelFactory class provides a build() method which automatically adds the channel instance to the dropwizard lifecycle.

TODO Example

Configuration

The following configuration settings are supported by GrpcChannelFactory:

  • hostname: Hostname of the gRPC server to connect to
  • port: Port of the gRPC server to connect to
  • shutdownDuration: How long to wait before giving up when the channel is shutdown

TODO Example

Maven Artifacts

This project is not yet available on Maven Central. You have to clone it and install it in your local maven repository. To add it to your project simply add the following dependencies to your pom.xml:

<dependency>
  <groupId>io.dropwizard.modules</groupId>
  <artifactId>dropwizard-grpc</artifactId>
  <version>1.0.0-1-SNAPSHOT</version>
</dependency>

Support

Please file bug reports and feature requests in GitHub issues.

License

Copyright (c) 2013-2016 Mario Steinhoff

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.

About

A set of classes to use a gRPC server in a Dropwizard service.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 98.8%
  • Shell 1.2%