From d545f86f66e51bf87f837d707feeb7cabc76de8d Mon Sep 17 00:00:00 2001 From: yilingfeng Date: Tue, 28 Feb 2017 19:22:00 +0800 Subject: [PATCH] [ROCKETMQ-111] Fix possible MQClientException when query message before today, closes apache/incubator-rocketmq#69 --- .../apache/rocketmq/common/message/MessageClientIDSetter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java b/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java index fe83cdde..a1d3ede2 100644 --- a/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java +++ b/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java @@ -52,7 +52,7 @@ public class MessageClientIDSetter { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(millis); cal.set(Calendar.DAY_OF_MONTH, 1); - cal.set(Calendar.HOUR, 0); + cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); @@ -74,7 +74,7 @@ public class MessageClientIDSetter { Calendar cal = Calendar.getInstance(); long now = cal.getTimeInMillis(); cal.set(Calendar.DAY_OF_MONTH, 1); - cal.set(Calendar.HOUR, 0); + cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); -- GitLab