Skip to content

Utility for integrating a gRPC client with Consul

Notifications You must be signed in to change notification settings

maxixcom/grpc-consul

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

grpc-consul

Utility for integrating a gRPC client with Consul.

Usage

ManagedChannelBuilder
	.forTarget("consul://<service name>")
	.nameResolverFactory(new ConsulNameResolverProvider())
	.loadBalancerFactory(RoundRobinLoadBalancerFactory.getInstance())
	...

If you don't want to use the default Consul agent host/port then use the alternative constructor and provide a HostAndPort pair.

Notes

Make sure that you don't override the provided Guava version (22.0) by mistake. A Spring Boot 2 starter will for example downgrade to 18.0, so throw in this if required:

  <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>22.0</version>
  </dependency>

About

Utility for integrating a gRPC client with Consul

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages