This commit is contained in:
李子铭 2025-03-20 19:19:04 +08:00
parent e0e9cc0102
commit 856d0058cb
1 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ func (w *WechatNotifyConsumer) consumeMessages(mqConsumer mq_http_sdk.MQConsumer
{ {
// Topic中没有消息可消费。 // Topic中没有消息可消费。
if strings.Contains(err.(errors.ErrCode).Error(), "MessageNotExist") { if strings.Contains(err.(errors.ErrCode).Error(), "MessageNotExist") {
fmt.Println("\nNo new message, continue!") //fmt.Println("\nNo new message, continue!")
} else { } else {
log.Errorf("ConsumeMessage Failed, err:%s\n", err) log.Errorf("ConsumeMessage Failed, err:%s\n", err)
time.Sleep(time.Duration(3) * time.Second) time.Sleep(time.Duration(3) * time.Second)
@ -120,7 +120,7 @@ func (w *WechatNotifyConsumer) consumeMessages(mqConsumer mq_http_sdk.MQConsumer
// 长轮询表示如果Topic没有消息则客户端请求会在服务端挂起3s3s内如果有消息可以消费则立即返回响应。 // 长轮询表示如果Topic没有消息则客户端请求会在服务端挂起3s3s内如果有消息可以消费则立即返回响应。
mqConsumer.ConsumeMessage(respChan, errChan, mqConsumer.ConsumeMessage(respChan, errChan,
5, // 一次最多消费3条最多可设置为16条 5, // 一次最多消费3条最多可设置为16条
15, // 长轮询时间3s最多可设置为30s 20, // 长轮询时间3s最多可设置为30s
) )
<-endChan <-endChan
} }