diff --git a/grpc.go b/grpc.go index 130123d..da533d4 100644 --- a/grpc.go +++ b/grpc.go @@ -128,6 +128,10 @@ func (g *Server) configure(opts ...server.Option) error { } } + for _, k := range g.opts.Codecs { + encoding.RegisterCodec(&wrapMicroCodec{k}) + } + maxMsgSize := g.getMaxMsgSize() gopts := []grpc.ServerOption{ @@ -809,10 +813,6 @@ func (g *Server) Start() error { config := g.Options() - for _, k := range config.Codecs { - encoding.RegisterCodec(&wrapMicroCodec{k}) - } - // micro: config.Transport.Listen(config.Address) var ts net.Listener var err error