rocketmq-spring icon indicating copy to clipboard operation
rocketmq-spring copied to clipboard

NPE by getDeliverTimeMs

Open dousp opened this issue 2 years ago • 0 comments

当DelayMode不是DELIVER_TIME_MILLISECONDS时,将Message对象toJSONString时,导致 Long.parseLong 抛出 NumberFormatException异常

Message中如下方法,this.getUserProperty(MessageConst.PROPERTY_TIMER_DELIVER_MS)返回了null.

public long getDeliverTimeMs() {
        return Long.parseLong(this.getUserProperty(MessageConst.PROPERTY_TIMER_DELIVER_MS));
 }

RocketMQTemplate中:

public SendResult syncSend(String destination, Message<?> message, long timeout) {
        return syncSend(destination, message, timeout, 0);
    }

dousp avatar May 06 '23 10:05 dousp