gemmellr commented on a change in pull request #729:
URL: https://github.com/apache/activemq/pull/729#discussion_r812024149



##########
File path: 
activemq-client/src/main/java/org/apache/activemq/ActiveMQSession.java
##########
@@ -1956,12 +1978,17 @@ protected void send(ActiveMQMessageProducer producer, 
ActiveMQDestination destin
             //Set the "JMS" header fields on the original message, see 1.1 
spec section 3.4.11
             message.setJMSDeliveryMode(deliveryMode);
             long expiration = 0L;
-            if (!producer.getDisableMessageTimestamp()) {
-                long timeStamp = System.currentTimeMillis();
+            long timeStamp = System.currentTimeMillis();
+            if (timeToLive > 0) {
+                expiration = timeToLive + timeStamp;
+            }
+
+            // TODO: AMQ-8500 - update this when openwire supports 
JMSDeliveryTime
+            message.setJMSDeliveryTime(timeStamp);

Review comment:
       I should probably also note that this call will fail even for a native 
5.x message, if the 1.1 API is the primary interface on the classpath, as the 
method 'wont exist' even though 5.x implements it. To avoid that you need to 
use an ActiveMQMessage impl ref to call the method rather than the Message 
interface.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to