activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nmitt...@apache.org
Subject svn commit: r413769 - in /incubator/activemq/trunk/activemq-core/src: main/java/org/apache/activemq/transport/stomp/Send.java test/java/org/apache/activemq/transport/stomp/StompTest.java
Date Mon, 12 Jun 2006 23:50:17 GMT
Author: nmittler
Date: Mon Jun 12 16:50:16 2006
New Revision: 413769

URL: http://svn.apache.org/viewvc?rev=413769&view=rev
Log:
Fixing AMQ-664 - making broker assign JMSTimestamp to all incoming stomp messages.  Updating
unit tests to verify timestamp is received properly via JMS.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Send.java
    incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Send.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Send.java?rev=413769&r1=413768&r2=413769&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Send.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/stomp/Send.java
Mon Jun 12 16:50:16 2006
@@ -81,6 +81,7 @@
 
         msg.setProducerId(format.getProducerId());
         msg.setMessageId(format.createMessageId());
+        msg.setJMSTimestamp(System.currentTimeMillis());
         
 
         ActiveMQDestination d = DestinationNamer.convert(destination);

Modified: incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java?rev=413769&r1=413768&r2=413769&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/transport/stomp/StompTest.java
Mon Jun 12 16:50:16 2006
@@ -155,6 +155,12 @@
         TextMessage message = (TextMessage) consumer.receive(1000);
         assertNotNull(message);
         assertEquals("Hello World", message.getText());
+        
+        // Make sure that the timestamp is valid - should
+        // be very close to the current time.
+        long tnow = System.currentTimeMillis();
+        long tmsg = message.getJMSTimestamp();
+        assertTrue( Math.abs(tnow - tmsg) < 1000 );
     }
 
     



Mime
View raw message