You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2022/03/15 19:31:07 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #3979: ARTEMIS-3711 support AMQ_SCHEDULED_DELAY for OpenWire clients

clebertsuconic commented on a change in pull request #3979:
URL: https://github.com/apache/activemq-artemis/pull/3979#discussion_r827341172



##########
File path: artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireMessageConverter.java
##########
@@ -224,6 +225,13 @@ public OpenWireMessageConverter() {
          coreMessage.putStringProperty(AMQ_MSG_ORIG_DESTINATION, origDest.getQualifiedName());
       }
 
+      final Object scheduledDelay = messageSend.getProperties().get(ScheduledMessage.AMQ_SCHEDULED_DELAY);
+      if (scheduledDelay instanceof Long) {
+         coreMessage.putLongProperty(org.apache.activemq.artemis.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + ((Long) scheduledDelay));
+         // this property may have already been copied, but we don't need it anymore
+         coreMessage.removeProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY);
+      }
+

Review comment:
       `      final Object scheduledDelay = messageSend.getProperties().get(ScheduledMessage.AMQ_SCHEDULED_DELAY);
          if (scheduledDelay instanceof Number) {
             coreMessage.putLongProperty(org.apache.activemq.artemis.api.core.Message.HDR_SCHEDULED_DELIVERY_TIME, System.currentTimeMillis() + ((Number) scheduledDelay).longValue());
             // this property may have already been copied, but we don't need it anymore
             coreMessage.removeProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY);
          }
   `




-- 
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.

To unsubscribe, e-mail: gitbox-unsubscribe@activemq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org