diff --git a/client/client.go b/client/client.go index 71efe65..40a1899 100644 --- a/client/client.go +++ b/client/client.go @@ -4,6 +4,7 @@ import ( cdr "git.loafle.net/commons/di-go/registry" "git.loafle.net/commons/logging-go" crc "git.loafle.net/commons/rpc-go/client" + crcodec "git.loafle.net/commons/rpc-go/codec" crpj "git.loafle.net/commons/rpc-go/protocol/json" crr "git.loafle.net/commons/rpc-go/registry" occp "git.loafle.net/overflow/commons-go/config/probe" @@ -15,13 +16,13 @@ import ( ) func New(portNumber int) *crc.Client { - rpcClientCodec := crpj.NewClientCodec() - connector, err := occ.NewConnector(occp.ContainerDiscovery, portNumber) if nil != err { logging.Logger().Panic(err) } + rpcClientCodec := crpj.NewCustomClientCodec(crcodec.NewCompressionCodecSelector(connector.GetCompressionThreshold())) + ch := &ClientHandlers{} ch.Name = occp.ContainerDiscovery.String() ch.Connector = connector