1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-12 22:07:47 +02:00

add changes for mercury

This commit is contained in:
Asim
2015-12-16 01:18:05 +00:00
parent ed75f84584
commit 271b827aa9
3 changed files with 19 additions and 9 deletions

View File

@ -64,14 +64,19 @@ func newRpcPlusCodec(req *transport.Message, client transport.Client, c codec.Ne
func (c *rpcPlusCodec) WriteRequest(req *request, body interface{}) error {
m := &codec.Message{
Id: req.Seq,
Method: req.ServiceMethod,
Type: codec.Request,
Id: req.Seq,
Target: req.Service,
Method: req.ServiceMethod,
Type: codec.Request,
Headers: map[string]string{},
}
if err := c.codec.Write(m, body); err != nil {
return err
}
c.req.Body = c.buf.wbuf.Bytes()
for k, v := range m.Headers {
c.req.Header[k] = v
}
return c.client.Send(c.req)
}