You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "carlye (via GitHub)" <gi...@apache.org> on 2025/05/19 08:48:58 UTC

[I] [Bug] rocketmq-clients/golang/v5 接收消息异常 [rocketmq-clients]

carlye opened a new issue, #1000:
URL: https://github.com/apache/rocketmq-clients/issues/1000

   ### Before Creating the Bug Report
   
   - [x] I found a bug, not just asking a question, which should be created in [GitHub Discussions](https://github.com/apache/rocketmq-clients/discussions).
   
   - [x] I have searched the [GitHub Issues](https://github.com/apache/rocketmq-clients/issues) and [GitHub Discussions](https://github.com/apache/rocketmq-clients/discussions)  of this repository and believe that this is not a duplicate.
   
   - [x] I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
   
   
   ### Programming Language of the Client
   
   Go
   
   ### Runtime Platform Environment
   
   Windows 11
   
   ### RocketMQ Version of the Client/Server
   
   5.3.2
   
   ### Run or Compiler Version
   
   docker
   
   ### Describe the Bug
   
   我rocketmq部署的docker rockermq版本为 5.3.2
   
   使用sdk为 github.com/apache/rocketmq-clients/golang/v5 v5.1.2
   
   我在监听rocketmq中一个消息到达的topic消息, 目前这个队列消息很少。Receive返回的消息报500错误,并有 null point 错误,偶尔中间还会出现夹杂有MESSAGE_NOT_FOUND错误。见日志。
   
   当我往队列中发送一条消息时,能正确接收到消息。但过一会应该是InvisibleDuration后,继续会报错。目前官方文档比较少,我不理解为什么会发生这样的错误,有谁可以帮助我一下吗?
   
   
   
   具体调用代码如下:
   ```go
   func (t *TopicListenr) Listen() {
   	defer t.consumer.GracefulStop()
   	defer log.Infof("MQ消息[%s]监听已经终止", t.topic)
   	for {
   		log.Debug("mq start recevie message")
   		mvs, err := t.consumer.Receive(context.TODO(), int32(t.appConfig.MessageDump.MQ.Consumer.MaxMessageNum), time.Duration(t.appConfig.MessageDump.MQ.Consumer.InvisibleDurationSeconds)*time.Second)
   
   		if err != nil {
   			log.Errorf("消息接收发生错误,%v", err)
   			return
   		}
   
   		if len(mvs) == 0 {
   			log.Debugf("当前未收到任何mq消息")
   			continue
   		}
   
   		msgList := make([]*vo.MqMessage, len(mvs))
   		for i, mv := range mvs {
   			msgList[i] = &vo.MqMessage{
   				Topic: mv.GetTopic(),
   				Body:  mv.GetBody(),
   			}
   			if mv.GetTag() != nil {
   				msgList[i].Tag = *mv.GetTag()
   			}
   		}
   
   		handleErr := t.handle.HandleMessage(msgList)
   
   		if handleErr == nil {
   			// 处理没有错误才会ack消息
   			// ack message
   			for _, mv := range mvs {
   				//可能需要处理这个error
   				t.consumer.Ack(context.TODO(), mv)
   				log.Debugf("messageview ack %v", mv.GetMessageId())
   			}
   		} else {
   			log.Errorf("处理消息报错,%v", handleErr)
   		}
   
   	}
   }
   ```
   
   
   ### Steps to Reproduce
   
   队列中没有消息时必现!
   
   ### What Did You Expect to See?
   
   能够尽快修复
   
   ### What Did You See Instead?
   
    能够尽快修复
   
   ### Additional Context
   
   错误日志如下:
   ```shell
   
   2025-05-19 16:37:32.633 DEBUG [service/mq.go:55] mq start recevie message
   2025-05-19 16:37:32.637 ERROR [service/mq.go:59] 消息接收发生错误,CODE: INTERNAL_SERVER_ERROR, MESSAGE: null. NullPointerException. org.apache.rocketmq.proxy.grpc.v2.consumer.ReceiveMessageActivity.receiveMessage(ReceiveMessageActivity.java:63)
   2025-05-19 16:37:32.637 INFO [service/mq.go:60] MQ消息[message_arrived]监听已经终止
   2025-05-19 16:37:32.637 INFO [service/message.go:124] 消息处理出现错误,等待5s后重试
   2025-05-19 16:37:37.735 DEBUG [service/mq.go:55] mq start recevie message
   2025-05-19 16:37:37.739 ERROR [service/mq.go:59] 消息接收发生错误,CODE: INTERNAL_SERVER_ERROR, MESSAGE: null. NullPointerException. org.apache.rocketmq.proxy.grpc.v2.consumer.ReceiveMessageActivity.receiveMessage(ReceiveMessageActivity.java:63)
   2025-05-19 16:37:37.739 INFO [service/mq.go:60] MQ消息[message_arrived]监听已经终止
   2025-05-19 16:37:37.739 INFO [service/message.go:124] 消息处理出现错误,等待5s后重试
   2025-05-19 16:37:42.789 DEBUG [service/mq.go:55] mq start recevie message
   2025-05-19 16:38:02.760 ERROR [service/mq.go:59] 消息接收发生错误,CODE: MESSAGE_NOT_FOUND, MESSAGE: no new message
   2025-05-19 16:38:02.761 INFO [service/mq.go:60] MQ消息[message_arrived]监听已经终止
   2025-05-19 16:38:02.761 INFO [service/message.go:124] 消息处理出现错误,等待5s后重试
   
   ```
   
   成功收到消息后还是会出错
   ```shell
   
   
   2025-05-19 16:39:13.732 INFO [service/mq.go:60] MQ消息[message_arrived]监听已经终止
   2025-05-19 16:39:13.732 INFO [service/message.go:124] 消息处理出现错误,等待5s后重试
   2025-05-19 16:39:18.803 DEBUG [service/mq.go:55] mq start recevie message
   2025-05-19 16:39:18.815 INFO [service/message.go:41] mq  got a message:[0xc001076100 0xc001076140 0xc001076180 0xc0010761c0 0xc001076200 0xc001076240]
   2025-05-19 16:39:18.927 DEBUG [dao/dao.go:240] [chatLog.T_CHAT_LOG]数据已经插入,ID:CMSU-P269-O8K5-4Q13,CMSU-P279-17I5-4Q13,CMSU-ORVT-T7C5-4Q13,CMSU-P29G-FDA5-4Q13,CMSU-OSRF-Q3Q5-4Q13,CMSU-OSSS-1GS5-4Q13,影响行数:6
   2025-05-19 16:39:18.927 DEBUG [dao/dao.go:89] [dao.SaveList] 耗时: 0.11
   2025-05-19 16:39:18.939 DEBUG [service/mq.go:87] messageview ack 010242AC1100050008083C881D00000022
   2025-05-19 16:39:18.947 DEBUG [service/mq.go:87] messageview ack 010242AC1100050008083C881D00000023
   2025-05-19 16:39:18.952 DEBUG [service/mq.go:87] messageview ack 010242AC1100050008083C88040000001F
   2025-05-19 16:39:18.957 DEBUG [service/mq.go:87] messageview ack 010242AC1100050008083C881D00000024
   2025-05-19 16:39:18.962 DEBUG [service/mq.go:87] messageview ack 010242AC1100050008083C880700000020
   2025-05-19 16:39:18.967 DEBUG [service/mq.go:87] messageview ack 010242AC1100050008083C880700000021
   2025-05-19 16:39:18.967 DEBUG [service/mq.go:55] mq start recevie message
   2025-05-19 16:39:38.927 ERROR [service/mq.go:59] 消息接收发生错误,CODE: MESSAGE_NOT_FOUND, MESSAGE: no new message
   2025-05-19 16:39:38.927 INFO [service/mq.go:60] MQ消息[message_arrived]监听已经终止
   2025-05-19 16:39:38.927 INFO [service/message.go:124] 消息处理出现错误,等待5s后重试
   2025-05-19 16:39:43.989 DEBUG [service/mq.go:55] mq start recevie message
   2025-05-19 16:39:43.994 ERROR [service/mq.go:59] 消息接收发生错误,CODE: INTERNAL_SERVER_ERROR, MESSAGE: null. NullPointerException. org.apache.rocketmq.proxy.grpc.v2.consumer.ReceiveMessageActivity.receiveMessage(ReceiveMessageActivity.java:63)
   2025-05-19 16:39:43.994 INFO [service/mq.go:60] MQ消息[message_arrived]监听已经终止
   
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] rocketmq-clients/golang/v5 接收消息异常 [rocketmq-clients]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1000:
URL: https://github.com/apache/rocketmq-clients/issues/1000#issuecomment-2998371243

   This issue was closed because it has been inactive for 3 days since being marked as stale.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] rocketmq-clients/golang/v5 接收消息异常 [rocketmq-clients]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #1000: [Bug] rocketmq-clients/golang/v5 接收消息异常
URL: https://github.com/apache/rocketmq-clients/issues/1000


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] rocketmq-clients/golang/v5 接收消息异常 [rocketmq-clients]

Posted by "wisonlau (via GitHub)" <gi...@apache.org>.
wisonlau commented on issue #1000:
URL: https://github.com/apache/rocketmq-clients/issues/1000#issuecomment-2896227282

   遇到同样的问题


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] rocketmq-clients/golang/v5 接收消息异常 [rocketmq-clients]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #1000:
URL: https://github.com/apache/rocketmq-clients/issues/1000#issuecomment-2993191472

   This issue is stale because it has been open for 30 days with no activity. It will be closed in 3 days if no further activity occurs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org