add message options

This commit is contained in:
Asim Aslam
2018-05-10 17:33:54 +01:00
parent b39ec4472c
commit c3c0543733
4 changed files with 24 additions and 8 deletions

View File

@@ -465,8 +465,8 @@ func (r *rpcClient) Publish(ctx context.Context, msg Message, opts ...PublishOpt
})
}
func (r *rpcClient) NewMessage(topic string, message interface{}) Message {
return newMessage(topic, message, r.opts.ContentType)
func (r *rpcClient) NewMessage(topic string, message interface{}, opts ...MessageOption) Message {
return newMessage(topic, message, r.opts.ContentType, opts...)
}
func (r *rpcClient) NewRequest(service, method string, request interface{}, reqOpts ...RequestOption) Request {