Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
21.26k
stars
11.7k
forks
source link
[Bug] Bug title 当消费者获取消息不存在的属性,服务端处理过程中会有异常,并把消息的消费状态设置为RECONSUME_LATER,无法进入消费逻辑,客户端也感知不到异常 #8702
Open
13735485496 opened 2 months ago
Before Creating the Bug Report
[X] I found a bug, not just asking a question, which should be created in GitHub Discussions.
[X] I have searched the GitHub Issues and GitHub 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.
Runtime platform environment
CentOS Linux release 7.9.2009 (Core)
RocketMQ version
JDK Version
java version "1.8.0_381" Java(TM) SE Runtime Environment (build 1.8.0_381-b09) Java HotSpot(TM) Client VM (build 25.381-b09, mixed mode, sharing)
Describe the Bug
第一个问题:当消费者获取消息的ORIGIN_MESSAGE_ID属性,这个属性在第一次就消费成功的时候,是不存在的,服务端处理的时候,捕获到了异常,就暴力的把消费的status设置为null,进而转入RECONSUME_LATER,这个会导致首次失败
第二个问题:当消费者获取消息不存在的属性,会有空指针异常,导致status设置为null,进而转入RECONSUME_LATER,这个会一直失败,直到进入死信队列
Steps to Reproduce
consumer.registerMessageListener(new MessageListenerConcurrently() { @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) {
for (MessageExt msg : msgs){
try {
What Did You Expect to See?
将异常返还给客户端
What Did You See Instead?
客户端没有收到任何异常结果
Additional Context
debug过程