Fix message stream miss ack

Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
xige-16 2021-03-02 13:15:49 +08:00 committed by yefu.chen
parent 3e5f05fc0a
commit 795cb74c85

View File

@ -335,6 +335,7 @@ func (ms *PulsarMsgStream) receiveMsg(consumer Consumer) {
if !ok {
return
}
consumer.Ack(pulsarMsg)
headerMsg := commonpb.MsgHeader{}
err := proto.Unmarshal(pulsarMsg.Payload(), &headerMsg)
if err != nil {
@ -430,6 +431,7 @@ func (ms *PulsarMsgStream) bufMsgPackToChannel() {
msgLen := len(consumer.Chan())
for i := 0; i < msgLen; i++ {
msg := <-consumer.Chan()
consumer.Ack(msg)
pulsarMsgBuffer = append(pulsarMsgBuffer, msg)
}
}