Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 68056 invoked from network); 23 Nov 2009 01:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Nov 2009 01:04:18 -0000 Received: (qmail 66743 invoked by uid 500); 23 Nov 2009 01:04:18 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 66696 invoked by uid 500); 23 Nov 2009 01:04:17 -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 66547 invoked by uid 99); 23 Nov 2009 01:04:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 01:04:17 +0000 X-ASF-Spam-Status: No, hits=-1998.9 required=10.0 tests=ALL_TRUSTED,FB_GET_MEDS X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 01:04:14 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id DAA45234C1E9 for ; Sun, 22 Nov 2009 17:03:53 -0800 (PST) Message-ID: <933678916.1258938233885.JavaMail.jira@brutus> Date: Sun, 22 Nov 2009 17:03:53 -0800 (PST) From: "Adam Walczak (JIRA)" To: dev@activemq.apache.org Subject: [jira] Updated: (AMQ-2504) Synchronize time without modifying the system date. In-Reply-To: <2143499785.1258892993389.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQ-2504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Adam Walczak updated AMQ-2504: ------------------------------ Description: 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 also would be an good idea I think 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). was: 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() > Synchronize time without modifying the system date. > --------------------------------------------------- > > Key: AMQ-2504 > URL: https://issues.apache.org/activemq/browse/AMQ-2504 > Project: ActiveMQ > Issue Type: Improvement > Components: JMS client > Reporter: Adam Walczak > > 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 also would be an good idea I think 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. - You can reply to this email to add a comment to the issue online.