ssssssnake opened a new issue #603: When consumeMessage throws a 
RuntimeException, you might not be able to get the root cause
URL: https://github.com/apache/rocketmq/issues/603
 
 
   `try {
                   ConsumeMessageConcurrentlyService.this.resetRetryTopic(msgs);
                   if (msgs != null && !msgs.isEmpty()) {
                       for (MessageExt msg : msgs) {
                           MessageAccessor.setConsumeStartTimeStamp(msg, 
String.valueOf(System.currentTimeMillis()));
                       }
                   }
                   status = 
listener.consumeMessage(Collections.unmodifiableList(msgs), context);
               } catch (Throwable e) {
                   log.warn("consumeMessage exception: {} Group: {} Msgs: {} 
MQ: {}",
                       RemotingHelper.exceptionSimpleDesc(e),
                       ConsumeMessageConcurrentlyService.this.consumerGroup,
                       msgs,
                       messageQueue);
                   hasException = true;
               }`
   
   when a RuntimeException is thrown, we only give a simple description which 
prints the first line of the stack trace, and sometimes it is difficult to find 
the root cause. 
   
   For example, if the following error is reported, we cannot know exactly 
which code is responsible for NumberFormatException.
   
   2018-12-13 13:26:10 WARN testStat27_1 
c.a.r.c.i.c.ConsumeMessageConcurrentlyService[] - consumeMessage exception: 
java.lang.NumberFormatException: null, java.lang.Long.parseLong(Long.java:404) 
Group: testStat27 Msgs: [MessageExt [queueId=3, storeSize=277, queueOffset=223, 
sysFlag=0, bornTimestamp=1544678768068, bornHost=/10.45.104.182:54292, 
storeTimestamp=1544678750316, storeHost=/172.16.17.33:20911, 
msgId=AC101121000051AF00000000001A225B, commitLogOffset=1712731, 
bodyCRC=362579089, reconsumeTimes=0, preparedTransactionOffset=0, 
toString()=Message [topic=hehe10, flag=0, properties={MSG_REGION=DefaultRegion, 
P_ID=PID_0011, KEYS=92, P_IP=10.45.104.182, 
UNIQ_KEY=0A2D68B64FC80A2C6F703E1B2BC4005C, MAX_OFFSET=224, 
CONSUME_START_TIME=1544678770461, MIN_OFFSET=0}, body=72]]] MQ: MessageQueue 
[topic=hehe10, brokerName=broker1, queueId=3]
   
   So, is it a better choice to print out the full stack trace or more?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to