[ 
https://issues.apache.org/jira/browse/QPID-5057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13740795#comment-13740795
 ] 

Pavel Moravec commented on QPID-5057:
-------------------------------------

Thanks for comments. I uploaded a new version of the patch that fixes just the 
format, and does not allow re-writing timestamp.

The timestamp setting would be another issue and moreover not valid one. As 
quoting JMS spec for setJMSTimestamp 
(http://docs.oracle.com/javaee/6/api/javax/jms/Message.html#setJMSTimestamp%28long%29):
 "This method can be used to change the value for a message that has been 
received." So no word about senders.

I checked neither expiration or timestamp is mentioned in consumers in Java 
client, hence no reverse conversion is required to be added to the patch.

>From the reproducer, 3rd message should be ignored (it tests setting 
>timestamp).
                
> Delivery properties "expiration" and "timestamp" are in milliseconds instead 
> of seconds
> ---------------------------------------------------------------------------------------
>
>                 Key: QPID-5057
>                 URL: https://issues.apache.org/jira/browse/QPID-5057
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Client
>    Affects Versions: 0.22
>            Reporter: Pavel Moravec
>            Priority: Minor
>         Attachments: QPID-5057.patch, SendMsgTimestamp.java
>
>
> Per AMQP 0.10 specification, message delivery properties  "expiration" and 
> "timestamp" are of type datetime, that is 64 bit POSIX time_t format, i.e. 
> "seconds since Epoch".
> But Java client implementation of both 0.8 and 0.10 protocol versions encodes 
> the properties in milliseconds. See e.g. 
> org/apache/qpid/client/BasicMessageProducer_0_10.java:
>         long currentTime = 0;
>         if (timeToLive > 0 || !isDisableTimestamps())
>         {
>             currentTime = System.currentTimeMillis();
>         }
>         if (timeToLive > 0)
>         {
>             deliveryProp.setTtl(timeToLive);
>             message.setJMSExpiration(currentTime + timeToLive);
>         }
>         if (!isDisableTimestamps())
>         {
>             deliveryProp.setTimestamp(currentTime);
>             message.setJMSTimestamp(currentTime);
>         }
> I.e. there should be "currentTime = System.currentTimeMillis()/1000;", rather.
> The same is in 0.8 client as well (while AMQP 0.8 specification does not know 
> either of the two delivery properties).
> I could propose a trivial patch for the 0.8 and 0.10 client, but I am not 
> sure how this affects:
> - AMQP 1.0 implementation I am not familiar with
> - (Java only?) broker or other clients utilizing the properties

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to