This commit is contained in:
wangchuxiao
2022-09-15 01:22:20 +08:00
parent 266a2b4c76
commit a1f79f4508
13 changed files with 187 additions and 26 deletions
+6
View File
@@ -4,8 +4,11 @@ import (
log "Open_IM/pkg/common/log"
"Open_IM/pkg/utils"
"errors"
"github.com/Shopify/sarama"
"github.com/golang/protobuf/proto"
promePkg "Open_IM/pkg/common/prometheus"
)
type Producer struct {
@@ -57,5 +60,8 @@ func (p *Producer) SendMessage(m proto.Message, key string, operationID string)
}
a, b, c := p.producer.SendMessage(kMsg)
log.Info(operationID, "ByteEncoder SendMessage end", "key ", kMsg.Key.Length(), kMsg.Value.Length(), p.producer)
if c == nil {
promePkg.PromeInc(promePkg.SendMsgCounter)
}
return a, b, utils.Wrap(c, "")
}