From 4c1f14fc477369d00dd9a9545394cffff18bd136 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Wed, 11 Nov 2020 14:08:58 +0100 Subject: [PATCH] use etcd as registry on rpc client --- ocis-pkg/service/grpc/service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ocis-pkg/service/grpc/service.go b/ocis-pkg/service/grpc/service.go index f349b6505d..0c90610f28 100644 --- a/ocis-pkg/service/grpc/service.go +++ b/ocis-pkg/service/grpc/service.go @@ -8,6 +8,9 @@ import ( "github.com/micro/go-micro/v2" mclient "github.com/micro/go-micro/v2/client" "github.com/micro/go-micro/v2/client/grpc" + + etcdr "github.com/micro/go-micro/v2/registry/etcd" + "github.com/micro/go-plugins/wrapper/trace/opencensus/v2" "github.com/owncloud/ocis/ocis-pkg/wrapper/prometheus" ) @@ -16,7 +19,8 @@ var DefaultClient = newGrpcClient() func newGrpcClient() mclient.Client { c := grpc.NewClient( - mclient.RequestTimeout(10 * time.Second), + mclient.RequestTimeout(10*time.Second), + mclient.Registry(etcdr.NewRegistry()), // this is a workaround and will force clients to ONLY use etcd as the registry. This needs to be configurable ) return c }