Add broker comments on server subscribe

This commit is contained in:
Asim Aslam 2020-01-19 01:16:36 +00:00
parent cafd280718
commit fc08a9146c
2 changed files with 2 additions and 1 deletions

View File

@ -653,6 +653,7 @@ func (g *grpcServer) Register() error {
opts = append(opts, broker.DisableAutoAck())
}
log.Logf("Broker [%s] Subscribing to topic: %s", config.Broker.String(), sb.Topic())
sub, err := config.Broker.Subscribe(sb.Topic(), handler, opts...)
if err != nil {
return err

View File

@ -654,12 +654,12 @@ func (s *rpcServer) Register() error {
opts = append(opts, broker.DisableAutoAck())
}
log.Logf("Broker [%s] Subscribing to topic: %s", config.Broker.String(), sub.Topic())
sub, err := config.Broker.Subscribe(sb.Topic(), s.HandleEvent, opts...)
if err != nil {
return err
}
log.Logf("Subscribing %s to topic: %s", node.Id, sub.Topic())
s.subscribers[sb] = []broker.Subscriber{sub}
}