Fix rocksmq bug

Signed-off-by: groot <yihua.mo@zilliz.com>
pull/4973/head^2
groot 2021-02-18 14:13:55 +08:00 committed by yefu.chen
parent 85c1404393
commit af3736aff6
2 changed files with 4 additions and 1 deletions

View File

@ -103,6 +103,9 @@ func (ms *RmqMsgStream) AsProducer(channels []string) {
err := rocksmq.Rmq.CreateChannel(channel)
if err == nil {
ms.producers = append(ms.producers, channel)
} else {
errMsg := "Failed to create producer " + channel + ", error = " + err.Error()
panic(errMsg)
}
}
}

View File

@ -128,7 +128,7 @@ func (rmq *RocksMQ) CreateChannel(channelName string) error {
// Check if channel exist
if rmq.checkKeyExist(beginKey) || rmq.checkKeyExist(endKey) {
return errors.New("Channel " + channelName + " already exists.")
return nil
}
err := rmq.kv.Save(beginKey, "0")