mirror of https://github.com/apache/activemq.git
Fixing AMQ-664 - making broker assign JMSTimestamp to all incoming stomp messages. Updating unit tests to verify timestamp is received properly via JMS.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@413769 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e264e6f9d1
commit
e9e8fd147d
|
@ -81,6 +81,7 @@ class Send implements StompCommand {
|
|||
|
||||
msg.setProducerId(format.getProducerId());
|
||||
msg.setMessageId(format.createMessageId());
|
||||
msg.setJMSTimestamp(System.currentTimeMillis());
|
||||
|
||||
|
||||
ActiveMQDestination d = DestinationNamer.convert(destination);
|
||||
|
|
|
@ -155,6 +155,12 @@ public class StompTest extends CombinationTestSupport {
|
|||
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 );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue