use msg.Subject as topic

This commit is contained in:
Asim Aslam 2017-01-12 20:21:49 +00:00 committed by Vasiliy Tolstov
parent 040c291e74
commit 8898b42bda

View File

@ -122,7 +122,7 @@ func (n *nbroker) Subscribe(topic string, handler broker.Handler, opts ...broker
if err := n.opts.Codec.Unmarshal(msg.Data, &m); err != nil { if err := n.opts.Codec.Unmarshal(msg.Data, &m); err != nil {
return return
} }
handler(&publication{m: &m, t: topic}) handler(&publication{m: &m, t: msg.Subject})
} }
var sub *nats.Subscription var sub *nats.Subscription