Return-Path: X-Original-To: apmail-activemq-dev-archive@www.apache.org Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 66C2D76E7 for ; Thu, 11 Aug 2011 21:38:52 +0000 (UTC) Received: (qmail 63279 invoked by uid 500); 11 Aug 2011 21:38:52 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 62852 invoked by uid 500); 11 Aug 2011 21:38:51 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 62844 invoked by uid 99); 11 Aug 2011 21:38:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 21:38:51 +0000 X-ASF-Spam-Status: No, hits=-1998.8 required=5.0 tests=ALL_TRUSTED,FB_GET_MEDS,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2011 21:38:48 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8AD9CB8DC3 for ; Thu, 11 Aug 2011 21:38:27 +0000 (UTC) Date: Thu, 11 Aug 2011 21:38:27 +0000 (UTC) From: "Adam Walczak (JIRA)" To: dev@activemq.apache.org Message-ID: <512531260.30744.1313098707565.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (AMQ-2504) Synchronize time without modifying the system date. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/AMQ-2504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13083661#comment-13083661 ] Adam Walczak commented on AMQ-2504: ----------------------------------- You can always sync the system time on a client machine ... > Synchronize time without modifying the system date. > --------------------------------------------------- > > Key: AMQ-2504 > URL: https://issues.apache.org/jira/browse/AMQ-2504 > Project: ActiveMQ > Issue Type: Improvement > Components: JMS client > Reporter: Adam Walczak > Fix For: 5.6.0 > > > I have a proposal to create a global variable in ActiveMQ's internals which alters the value of System.getCurrentMillis(). Thanks to this we should be able to synchronize clients connected to a JMS server (equipped with an additional NTP server for example) with out modifying their system dates. > Scenario: > 1. Servers system date is sync'ed with an NTP server. > 2. Clients retrieve their time difference from the NTP server > 3. The client set ActiveMq...setTimeDifferenceToServer(...) > 4. Every call for system millis in ActiveMQ sources looks like this: System.getCurrentMillis() + ActiveMq...getTimeDifferenceToServer() > I think it also would be an good idea to wrapper the System.getCurrentMillis() in a internal ActiveMQ method and never call it again directly. This would allow the above modifications and perhaps a to transit to System.nanoTime() to indicate millis in the future which is far more accurate (getCurrentMillis() has a 0-20ms error range). -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira