mirror of
https://github.com/apache/rocketmq.git
synced 2026-09-19 02:23:24 +08:00
add getter for class Message ,fix json serialize bug (#7439)
Co-authored-by: LetLetMe <allen.hyt@alibaba-inc.com>
This commit is contained in:
@@ -218,14 +218,36 @@ public class Message implements Serializable {
|
||||
public void setDelayTimeSec(long sec) {
|
||||
this.putProperty(MessageConst.PROPERTY_TIMER_DELAY_SEC, String.valueOf(sec));
|
||||
}
|
||||
|
||||
public long getDelayTimeSec() {
|
||||
String t = this.getProperty(MessageConst.PROPERTY_TIMER_DELAY_SEC);
|
||||
if (t != null) {
|
||||
return Long.parseLong(t);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setDelayTimeMs(long timeMs) {
|
||||
this.putProperty(MessageConst.PROPERTY_TIMER_DELAY_MS, String.valueOf(timeMs));
|
||||
}
|
||||
|
||||
public long getDelayTimeMs() {
|
||||
String t = this.getProperty(MessageConst.PROPERTY_TIMER_DELAY_MS);
|
||||
if (t != null) {
|
||||
return Long.parseLong(t);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setDeliverTimeMs(long timeMs) {
|
||||
this.putProperty(MessageConst.PROPERTY_TIMER_DELIVER_MS, String.valueOf(timeMs));
|
||||
}
|
||||
|
||||
public long getDeliverTimeMs() {
|
||||
return Long.parseLong(this.getUserProperty(MessageConst.PROPERTY_TIMER_DELIVER_MS));
|
||||
String t = this.getProperty(MessageConst.PROPERTY_TIMER_DELIVER_MS);
|
||||
if (t != null) {
|
||||
return Long.parseLong(t);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user