jbertram commented on a change in pull request #3279:
URL: https://github.com/apache/activemq-artemis/pull/3279#discussion_r533454128
##########
File path:
artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/Message.java
##########
@@ -636,6 +641,19 @@ default Object getBrokerProperty(SimpleString key) {
return getObjectProperty(key);
}
+ default Message setIngressTimestamp() {
+ setBrokerProperty(HDR_INGRESS_TIMESTAMP, System.currentTimeMillis());
+ return this;
+ }
+
+ default Long getIngressTimestamp() {
+ Object result = getBrokerProperty(HDR_INGRESS_TIMESTAMP);
+ if (result == null) {
+ return null;
+ }
Review comment:
For some reason I had in my head that trying to cast a `null` would
throw a `NullPointerException`. Will fix.
##########
File path:
artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
##########
@@ -1339,6 +1339,21 @@ public Object getBrokerProperty(SimpleString key) {
return extra.getProperty(key);
}
+ @Override
+ public final org.apache.activemq.artemis.api.core.Message
setIngressTimestamp() {
+ setMessageAnnotation(AMQPMessageSupport.INGRESS_TIMESTAMP,
System.currentTimeMillis());
+ return this;
+ }
+
+ @Override
+ public Long getIngressTimestamp() {
+ Object result =
getMessageAnnotation(AMQPMessageSupport.INGRESS_TIMESTAMP);
+ if (result == null) {
+ return null;
+ }
Review comment:
For some reason I had in my head that trying to cast a `null` would
throw a `NullPointerException`. Will fix.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]